Convert integers into words.
Features and limitations:
- Languages: English and Japanese.
- Integer range: 0 → 253–1.
- While 64-bit floating-point numbers technically support numbers up to approximately 1.8 × 10308, there is a significant loss of precision. 253–1 is the largest integer with no loss of precision.
npm install int2words
For legacy browsers:
import { int2en, int2jp } from 'int2words';
console.log(int2en(321)); // "three hundred twenty-one"
console.log(int2jp(321)); // "三百二十一"
For legacy browsers:
Change name and modernize.
- Originally a modification from http://stackoverflow.com/questions/14766951/convert-digits-into-words-with-javascript.
This project is licensed under the GNU General Public License (GPL).