# nv-string-pos-int-lt1e21

> nv-string-pos-int-lt1e21 ======================= - same as Number.toString() - but only work WHEN number is integer AND number >0 AND number < 1e21 - slightly faster than built-in .toString()

Latest version **1.0.2** (published 2023-06-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install nv-string-pos-int-lt1e21
pnpm add nv-string-pos-int-lt1e21
yarn add nv-string-pos-int-lt1e21
bun add nv-string-pos-int-lt1e21
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-06-23 |
| First published | 2023-06-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ihgazni2 |

## Links

- npm: https://www.npmjs.com/package/nv-string-pos-int-lt1e21
- npm.io page: https://npm.io/package/nv-string-pos-int-lt1e21

## Recent versions

- 1.0.2 (latest) — 2023-06-23
- 1.0.1 — 2023-06-23

## README

nv-string-pos-int-lt1e21
=======================
- same as Number.toString()
- but only work  WHEN  number is integer AND number >0  AND number < 1e21
- slightly faster than built-in .toString()

install
=======
- npm install nv-string-pos-int-lt1e21


usage
=====
    
      const {pos_i2s_if_gt0_and_lt_1e21 }   = require("nv-string-pos-int-lt1e21");
 

example
-------

		const rand_int = ()=>require("nv-random-number").int(1,2**53);
		  

		// random samples for test
		const narr = [];
		const sarr = [];
		for(let i=0;i<1000000;++i) {
		    let int = rand_int();
		    let s   = int.toString();
		    narr.push(int);
		    sarr.push(s);
		}

		const {pos_i2s_if_gt0_and_lt_1e21} = require("../index");


		var S;

		//assert
			for(let i=0; i<1000000;++i) {
			    let n = narr[i]
			    let s = pos_i2s_if_gt0_and_lt_1e21(n);
			    if(s!==sarr[i]) {
				console.log(sarr[i],n,s)
			    }
			}
		////


		const f0 = ()=> {
			for(let i=0; i<1000000;++i) {
			    let n = narr[i]
			    S = n.toString();
			}
		}

		const f1 = ()=> {
			for(let i=0; i<1000000;++i) {
			    let n = narr[i]
			    S = pos_i2s_if_gt0_and_lt_1e21(n)
			}
		}

		const {sync} = require("nv-facutil-simple-test")

		console.log(sync(10,f0));
		console.log(sync(10,f1));


		{ rounds: 10, f: [Function: f0], costed: 2530.5817646980286 }
		{ rounds: 10, f: [Function: f1], costed: 1408.7329750061035 }

METHODS
========


APIS
=======


LICENSE
=======
- ISC

---
_Source: https://npm.io/package/nv-string-pos-int-lt1e21 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
