reformat-number

1.0.0 • Public • Published

Reformat-Number · GitHub license

re-format javascript string-numbers with ease

GitHub license npm Codacy Badge Codacy Badge

This is a simple but opinionated number re-formatter.

  • Input: a valid number which might contain commas and a dot for decimal separation.
  • Output: same number with commas on right places (between each three digits group).

Instalation

yarn add reformat-number

Usage

const reformat = require('reformat-number');
 
reformat('1234567890'); // => '1,234,567,890'
reformat('123,456,7890'); // => '1,234,567,890'
reformat('-12345678.90'); // => '-12,345,678.90'
reformat('1,2,3,4,5,6'); // => '123,456'

Package Sidebar

Install

npm i reformat-number

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

3.83 kB

Total Files

4

Last publish

Collaborators

  • carloluis