spell-out

0.2.0 • Public • Published

SpellOut

This will help convert number to its alphabetical equivalent form.

Example:

const { SpellOut } = require("spell-out");

SpellOut(12345678); // -- One Crore Twenty Three Lakh Fourty Five Thousand Six Hundred Seventy Eight

SpellOut("12345678"); // -- One Crore Twenty Three Lakh Fourty Five Thousand Six Hundred Seventy Eight

Example with format parameter:

  • By default format is set to I, which stands for INDIAN FORMAT
  • So we don't have to pass it if we want output in indian format.
  • Other option for format is U, which stands for INTERNATIONAL FORMAT
  • Below code depicts the same example as above but with "U" format.
SpellOut("12345678", "U"); // --- Twelve Million Three Hundred and Forty Five Thousand Six Hundred and Seventy Eight

TODOs:

  • [x] USD output format (This is completed planned in next released)
  • [ ] Support for comma seperated numbers, like 12,345,678 or 1,23,45,678
  • [ ] Support for larger number till Number.MAX_SAFE_INTEGER

Bugs

App

Author: Mujibur Rehman

Readme

Keywords

Package Sidebar

Install

npm i spell-out

Weekly Downloads

3

Version

0.2.0

License

MIT

Unpacked Size

8.05 kB

Total Files

7

Last publish

Collaborators

  • macos