Novelty Polygonal Mathematics

# npm

Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

## js-number-to-word-processor

3.0.2 • Public • Published

# JavaScript Number To Word Processor

#### ` -97,000,005,430,000.98,766,537,867 ` => `(negative) Ninety-Seven Trillion, and Five Million, Four Hundred and Thirty Thousand (dot) Ninety-Eight Billion, Seven Hundred and Sixty-Six Million, Five Hundred and Thirty-Seven Thousand, Eight Hundred and Sixty-Seven hundred-billionths.`

The Goal Of JSnumberToWordProcessor Is A Well Formatted Human Readable ` Number, ` With It's Corresponding ` Words. `
JSnumberToWordProcessor Is A Pure Vanilla JavaScript Plugin With No Dependencies.

## UPDATE

###### Version: 3.0.2
1. Application Now Handles Decimal Numbers, With Fractions.
1. For decimal numbers, users can pass in a second argument which would indicate the decimal number length
2. If a second argument isn't passed in for decimal numbers, a default 2 decimal point would be used
2. Application Now Handles Negative Numbers.
3. Application Can Solve Arithmetic Operations and Output The Result In Human Readable Number & Word

## Use In Project:

###### NOTE <br/ >

Always Use BigInteger / BigInt or Number String When Dealing With Big Numbers Above 2^53-1

e.g
877373863274895753n or '877373863274895753'
OR
BigInt(245786743890965998) or '245786743890965998'

Call JSnumberToWordProcessor & PASS In Either A Positive Whole Number, BigInteger, OR Number-String

###### SOLVE Arithmetic Operations
`````` When Solving Arithmetic Calculations (+), Always Pass Arguments As Numbers, OR BigIntegers, <br />
Other Arithmetic Operations Could Be Passed In As A Numbers, BigInteger, OR As A String.
``````
###### Use BigInteger / BigInt

Define The Decimal Place Length With A Second Number Argument

NOTE: The Second Argument Would Only Be Called On A Decimal Number If The Second Argument Is Greater Than The Decimal Point Length, A Default 2 Decimal Point Would Be Used

###### PROCESS Booleans
``````NOTE: 0 === false && 1 === true
``````

#### How To Use JSnumberToWordProcessor Plugin In Your Project

• Install JSnumberToWordProcessor Plugin In Your Project File
OR
Download, And Attach `curStrLengthFunc_2.min.js` & `JSnumberToWordProcessor.js` Script To Your HTML Document.
• Ensure You Pass in The Number Argument As A String OR As A BigInter().
This Is Because JavaScript Has A Number Length Limit Of 2^53-1.
But If You Would Be Dealing With Numbers Less Than 2^53-1 Length,
Then Feel Free To Input A Number As Your Argument.
For Decimal Numbers
Pass A The Second Argument Which Could either Be A Number Or A String. If No Second Argument Is Passed In For Decimal Numbers Or The Second Argument Is Greater Than The Actual Decimal Number Length, A default Value Of 2 Decimal Number Length Is Used.
e.g
`JSnumberToWordProcessor('123456.78998765', 5)`
OR
`JSnumberToWordProcessor(['123.98765', '445.556', '68', '8575.7766', '84974'], 3)`.
• Alternatively;
Just Append `(n)` (Without Parentheses) to The End Of The Number Longer Than 2^53-1
e.g.
`123456789098765432n`
OR
`[123456789098765433n, BigInt(123456789098765434), 123456789098765434n]`.
This Calls The BigInt() Method Which Allows JavaScript To Handle BIG Numbers.
• Better Still;
Just Check JSnumberToWordProcessor's index.html & See How It's Been Put To Use
OR
Check Proforma Invoice Calculator To See JSnumberToWordProcessor At Work
• Display The Result In Your Project.

## UPDATE History

###### Version: 2.0.5
1. Corrected Read Me installation process.
2. Code Optimized.
###### Version: 2.0.4
1. Application Can Now Process Numbers Up To "`10^33003`", Into Human Readable Numbers & Words Based On Conway-Wechsler Numbering System.
2. Optimized Code For Efficiency (Rewrote Most Part).
3. Pure Vanilla JS With No Dependencies.
###### Version: 1.1.0
1. Application Can Now Handle Numbers Larger Than `2^53-1` Up To `10^126`.
2. Spelling Errors Corrected.
3. Code Refined.

## Install From:

###### Proforma Invoice Calculator is Another Application Using #JSnumberToWordProcessor

JavaScript Number To Word Processor Is Developed By Saheed Odulaja.
Feel Free To Fork This Repository.
Also Be Kind Enough To Leave A STAR 🌟 As A Mark Of Encouragement 😃.

### Install

`npm i js-number-to-word-processor`

12

3.0.2

MIT

773 kB

5