abbr-number-to-string

1.0.2 • Public • Published

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.

/abbr-number-to-string/

    Package Sidebar

    Install

    npm i abbr-number-to-string

    Weekly Downloads

    3

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    4.19 kB

    Total Files

    6

    Last publish

    Collaborators

    • daltonh