Convert numbers to spoken word formats (e.g. 1375 becomes thirteen seventy five). Various formatting options are provided to support simple digits, c
$ npm install --save spoken-numbers
var spokenNumbers = require('spoken-numbers');
var words1 = spokenNumbers.toSpoken(1724, 'dd'); // => 'seventeen twenty four'
var words2 = spokenNumbers.toSpoken(1701, 'dd:o'); // => 'seventeen o one'
var words3 = spokenNumbers.toSpoken(1000, 'dd:o'); // => 'ten zero zero'
var words4 = spokenNumbers.toSpoken('AA1901', 'dd:o'); // => 'A A nineteen o one'
var words5 = spokenNumbers.toSpoken('AA1901', 'd'); // => 'A A one nine zero one'
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
This code is licensed under the MIT license for Scott Beaudreau. For more information, please refer to the LICENSE file.