Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
any-number-to-words
Advanced tools
A string based number to word converter that can convert pretty large numbers to words in several locales. String is it's limit.
A string based number to words converter. It can convert from very small to large decimal numbers(just for fun 🌈).
See Live Demo
npm i any-number-to-words
ES6 module format:
import {Converter} from "any-number-to-words";
const converter = new Converter();
CommonJS module format:
const {Converter} = require("any-number-to-words");
const converter = new Converter();
The default locale is enUS
(English). To convert in to other locales(eg. bnBD
) you also need to import or require the locales:
// bnBD is for Bengali
import {Converter, bnBD} from "any-number-to-words";
const converter = new Converter(bnBD);
Or
const {Converter, bnBD} = require("any-number-to-words");
const converter = new Converter(bnBD);
Syntax:
converter.toWords(number|string, [options]);
number|string
): It can be a JavaScript number or a string. If it is a string it should follow the same syntax as JavaScript decimal number.[options|locale]
, optional): It is used to provide optional settings like comma separator: {comma: true}
. However it can be used to override the whole locale. Or it can given some locale too to use that local temporarily.Examples:
// --- assuming the locale is enUS ---
converter.toWords(1729); // → one thousand seven hundred twenty-nine
// turn on commas
converter.toWords(1729, {comma: true}); // → one thousand, seven hundred twenty-nine
// string as input
converter.toWords('1729'); // → one thousand, seven hundred twenty-nine
// You can also use exponent notation
converter.toWords('1729e100'); // → seventeen tretrigintillion twenty-nine googol
That's basically it. Have fun!
enUS
for English.bnBD
for Bengali.hiIN
for Hindi.Contributions, comments and/or bug reports are very much appreciated. Open a pull request or add comments on the issues page. Thanks!
MIT
Converter
as named export.bnBD
and hiIN
.FAQs
A string based number to word converter that can convert pretty large numbers to words in several locales. String is it's limit.
The npm package any-number-to-words receives a total of 198 weekly downloads. As such, any-number-to-words popularity was classified as not popular.
We found that any-number-to-words demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.