nist-number
v1.1.0
Published
Number (digit) grouping with spaces, according to NIST
Downloads
1
Maintainers
Readme
Formats numbers into groups of three digits separated with space, as used by NIST et. al.
See tests.
Install:
npm install --save nist-number
Use:
var nistNumber = require('nist-number')
nistNumber(123456) // = '123 456'
nistNumber(-123456) // = '-123 456'
nistNumber(-123456.7891 // = '-123 456.7891'
nistNumber(undefined) // = null
nistNumber(null) // = null
nistNumber('string is not a number') // = null
nistNumber({lol: 'object'}) // = null