Socket
Socket
Sign inDemoInstall

number-spell-out

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    number-spell-out

Utility function for spelling the numbers both in international and in indian styles.


Version published
Maintainers
1
Install size
12.6 kB
Created

Readme

Source

number-spell-out

License test Strict TypeScript Checked

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' }

FAQs

Last updated on 11 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc