Skip to content

Latest commit

 

History

History
54 lines (31 loc) · 1.34 KB

README.md

File metadata and controls

54 lines (31 loc) · 1.34 KB

Number formatter

To run this package on your application

step 1 :install the package

npm install number-formatter-npm

step 2 :import the package

const {numberFormatter}=require('number-formatter-npm')

step 3 :use functionalities

Here in this package you can convert any number into formatted strings

Use case 01

To format numbers in 100,060,129 order

numberFormatter({number:, round:, format:'standard'})

numberFormatter({number:554644.886, round:2, format:'standard'})
output=> 554,644.89

numberFormatter({number:554644, round:2, format:'standard'})
output=> 554,644

numberFormatter({number:554644.8486, round:3, format:'standard'}) output=> 554,644.849

use case 02

To format numbers in 100k,100M,100B order

numberFormatter({number:, round:, format:'default'})

numberFormatter({number:554644.886, round:2, format:'default'})
output=> 554.64k

numberFormatter({number:554644, round:2, format:'default'}) output=> 554.64k

numberFormatter({number:554644, round:4, format:'default'}) output=> 554.6440k

use case 03

To format numbers in currency order such as 100.00

numberFormatter({number:, format:'currency'})

numberFormatter({number:5546.886, format:'currency'})
output=> 5,546.89