word-number-converter
v1.0.7
Published
A simple JavaScript library to convert numbers to words and words to numbers. Works in both Node.js and browser environments.
Maintainers
Readme
word-number-converter
A simple JavaScript library to convert numbers to words and words to numbers. Works in both Node.js and browser environments.
✨ Features
- Convert words to numbers:
'three thousand twenty' → 3020 - Convert numbers to words:
999 → 'nine hundred ninety-nine' - Supports thousands and millions
- Handles
"and"or hyphenated numbers like"twenty-one"
🚀 Installation
npm install word-number-converterExample-Usage
import {toNumber, toWords} from "word-number-converter;
console.log(toNumber("One thousand one hundred")); Result: 1100 console.log(toWords(1998)); Result: one thousand nine hundred ninety-eight
