Angular pipe that converts number to words
npm install ng-number2wordsbash
npm install ng-number2words
`
Demo
https://sprajwal078.github.io/ng-number2words/
Usage
Import the NgNumber2wordsModule in your app.module.ts
`js
import { NgNumber2wordsModule } from 'ng-number2words';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
NgNumber2wordsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
`
then use toWords pipe wherever required
`html
{{14600728195 | toWords}}
`
will output:\
fourteen billion six hundred million seven hundred twenty eight thousand one hundred ninety five
`html
{{12.32 | toWords}}
`
will output:\
twelve point three two
Language Support
Supported Languages:
- Spanish
`html
{{97545678849 | toWords : 'es'}}
`
will output:\
noventa y siete mil quinientos cuarenta y cinco millones seiscientos setenta y ocho mil ochocientos cuarenta y nueve
Hindu-Arabic System
`html
{{235678943226 | toHinduArabicWords}}
`
will output:\
two kharab thirty five arab sixty seven crore eighty nine lakh forty three thousand two hundred twenty six
$3
Languages Supported:
- Nepali
`html
{{14600728195 | toHinduArabicWords: 'np'}}
`
will output:\
चौध अर्ब साठ्ठी करोड सात लाख अठ्ठाइस हजार एक सय पन्चान्नब्बे
`html
{{26.54 | toHinduArabicWords: 'np'}}
`
will output:\
छब्बीस दशमलब पाँच चार
TODO
- Enable additional languages support
- Enable currency style display
Note
This project is build using angular library generator. You can find the source files for the module in /projects/ng-number2words`