Converts Currency Numbers (including decimal points) into words.
- 1 --> one dollar
- 25.1 --> twenty-five dollars and ten cents
- 0.01 --> zero dollars and one cent
- 25.1 --> twenty-five cedis and ten pesewas
npm install currency-to-words --save
import { CurrencyToWords } from 'currency-to-words'
const words = CurrencyToWords({ value: 0.01 });
const customCurrency = CurrencyToWords({ value: 0.01, bigCurrency: 'dollar', lowCurrency: 'cent' });
OR
const words = CurrencyToWords({ value: '105' });
const customCurrency = CurrencyToWords({ value: '105', bigCurrency: 'cedi', lowCurrency: 'pesewa' });
value: oneOfType([number, string])
bigCurrency?: string
lowCurrency?: string
bigCurrency: 'Ghana Cedi'
lowCurrency: 'pesewa'
- Supporting other languages
Meisam Malekzadeh