shortscale

4.1.1 • Public • Published

shortscale

CI

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.

Example

import { shortscale } from 'shortscale';

console.log(shortscale(420000999015));
// four hundred and twenty billion nine hundred and ninety nine thousand and fifteen

ESM

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.

Rust

For Rust version see jldec/shortscale-rs.

Readme

Keywords

Package Sidebar

Install

npm i shortscale

Weekly Downloads

4

Version

4.1.1

License

MIT

Unpacked Size

5.44 kB

Total Files

4

Last publish

Collaborators

  • jldec