1.0.2 • Published 5 years ago

abbr-number-to-string v1.0.2

Weekly downloads
98
License
MIT
Repository
github
Last release
5 years ago

Abbr-number-to-string

MIT license npm version Build Status

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.