Skip to content

SimplySylvia/Abbreviate-Number-NPM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abbr-number-to-string

MIT license npm version Build Status Greenkeeper badge

A simple package to convert number data types into an abbreviated string. It takes in two arguments: the number to convert and the amount of decimal places you would like to round up to.

abbrNum(3567, 2) will become 3.57K

abbrNum(2942345,1) will become 2.9M

abbrNum(9876234987,3) will become 9.876B

Installation:

npm i abbr-number-to-string --save

Usage:

const abbrNum = require('abbr-number-to-string')

abbrNum(number,decimalpoints)

Uses Mocha and Travis for testing.

About

A package to turn numbers into shortened strings based on the amount of decimal points given

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published