1.0.13 • Published 3 years ago

millifytolongify v1.0.13

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

millifytolongify

Converts long numbers into strings and vice versa.

Demo

Use convertToMillify method

BeforeAfter
2000'2K'
2000000'2M'
2000000000'2B'
2000000000000'2T'
2000000000000000'2Q'

Use convertToLongForm method

BeforeAfter
'2K'2,000.00
'2M'2,000,000.00
'2B'2,000,000,000.00
'2T'2,000,000,000,000.00
'2Q'2,000,000,000,000,000.00

Install

Get it on npm:

npm install millifytolongify

Usage

Import package where numbers needs to be converted:

import { millifytolongify } from 'millifytolongify'

#### To conver numbers with short form to comma separated value in long form
//By default converted value is in decimal format.
millifytolongify.convertToLongForm('2k');
//'2,000.00'

// If we dont want value in decimal format,then pass flag as false in convertToLongForm method
millifytolongify.convertToLongForm('2k',false);
//'2,000'

####  To millify numbers
millifytolongify.convertToMillify(2000.00); 
//'2K'

Author

npm.io

1.0.13

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago