npm.io
1.0.2 • Published 5 years ago

number2currency

Licence
ISC
Version
1.0.2
Deps
0
Size
3 kB
Vulns
0
Weekly
0

NPM

Number To currency or Words

Contains some util methods for converting numbers into words and currency type INR

Install

npm install number2currency

API

toWords(number)

Converts an integer into a string with words. If number is decimal, the decimals will be removed.

var converter = require('number2currency');
converter.toWords(21); // => “twenty one”
toWords(string)

Converts string into words. If number is decimal, the decimals will be removed.

var converter = require('number2currency');
converter.toWords('13'); // => “thirteen”

// Decimal numbers:
converter.toWords(2.9); // => “two”

// Large numbers:
converter.toWords(900712003); // => “ninety crore seven lakh twelve thousand three”
Change Log
1.0.0
  • Initial release

Keywords