spoken-numbers
Convert numbers to spoken word formats (e.g. 1375 becomes thirteen seventy five). Various formatting options are provided to support simple digits, c
Install with npm
$ npm install --save spoken-numbers
Usage
var spokenNumbers = ; var words1 = spokenNumbers; // => 'seventeen twenty four'var words2 = spokenNumbers; // => 'seventeen o one'var words3 = spokenNumbers; // => 'A A nineteen o one'var words4 = spokenNumbers; // => 'A A one nine zero one'
Formats
d
- Formats all numbers as individual digits. Example:14,302,033
becomesone four three zero two zero three three
dd
- Formats all numbers as individual digits. Example:14,30,20,33
becomesfourteen thirty twenty thirty three
w
- Formats all numbers in a verbose form, including named units. Example:14,302,033
becomesfourteen million three hundred and two thousand thirty three
d:o
- Formats all numbers as individual digits but replaceszero
with0
. Example:14,302,033
becomesone four three o two o three three
License
This code is licensed under the MIT license for Scott Beaudreau. For more information, please refer to the LICENSE file.