number-spell-out
v0.0.2
Published
Utility function for spelling the numbers both in international and in indian styles.
Downloads
1
Maintainers
Keywords
Readme
number-spell-out
Usage
import { spellNumber, humanizeNumber, NumberSpellingMode } from 'number-spell-out';
const spelledNumber = spellNumber(300000000);
// [ { value: 300, name: 'billions' } ]
const spelledNumber = spellNumber(41500000, NumberSpellingMode.INDIAN);
/*[
{
value: 4,
name: 'crore',
},
{
value: 15,
name: 'lakh,
},
]
*/
const humanizedNumber = humanizeNumber(300000000);
//{ value: 300, name: 'billions' }
const humanizedNumber = humanizeNumber(41500000, NumberSpellingMode.INDIAN);
// { value: 4.15, name: 'crore' }