react-number2words
v1.0.1
Published
React component that converts number to words
Downloads
33
Maintainers
Readme
React Number2words
React component to convert number into words.
Demo
https://sprajwal078.github.io/react-number2words-demo/
Installation
npm install react-number2words
Usage
import Number2Words from 'react-number2words';
Then in your react app you can use
<Number2Words value={123.53} />
Examples
Default
<Number2Words value={14600728195} />
will outputfourteen billion six hundred million seven hundred twenty eight thousand one hundred ninety five
Decimal Value
<Number2Words value={12.32} />
will outputtwelve point three two
Hindu-Arabic System
<Number2Words value={235678943226} system={hinduArabic}/>
will outputtwo kharab thirty five arab sixty seven crore eighty nine lakh forty three thousand two hundred twenty six
Hindu Arabic - Language Support
Currently only Nepali language is supported. This is because Nepali is my native language and I am familiar with the Nepalese writing and number system. Please feel free to contrubute to this project to support a language of your choice or provide me some info by creating a feature request in the issues section.
<Number2Words value={14600728195} system={hinduArabic} language="np"/>
will outputचौध अर्ब साठ्ठी करोड सात लाख अठ्ठाइस हजार एक सय पन्चान्नब्बे
Decimal Input
<Number2Words value={26.54} system={hinduArabic} language="np"/>
will outputछब्बीस दशमलब पाँच चार
TODO
- Enable support additional languages
- Enable currency conversion