Skip to content

Takes a long number and translates to a beautifully short number

License

Notifications You must be signed in to change notification settings

2JJ1/npm-number-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

number-shortener

Takes a long number and translates to a beautifully short number.

1000 = 1k

2600000 = 2.6m

301000000001 = 301b+

99999999999999 = 99.9t+

x > 9999999999999999 = scientific notation

Installing

Using NPM

npm i number-shortener

Example

Import

const shortNum = require('number-shortener')
shortNum(301000000001) //returns 301b+
shortNum(9999999999999999999991) //returns 1e+22

About

Takes a long number and translates to a beautifully short number

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published