Converts numbers into English words.
This module was written as an exploration of JavaScript and Rust documented here.
The short scale, has different words for each power of 1000.
Supports positive integers from 0 to Number.MAX_SAFE_INTEGER (9,007,199,254,740,991).
All other values return undefined.
import { shortscale } from 'shortscale';
console.log(shortscale(420000999015));
// four hundred and twenty billion nine hundred and ninety nine thousand and fifteen
As of v2.0 , this library is packaged as an ESM module.
To call from CommonJS use dynamic import(), or use require() with version ^1.1.0
in package.json.
See example-CJS-v1, example-CJS-v2, example-ESM.
For Rust version see jldec/shortscale-rs.