currency-in-word
v1.3.0
Published
A lightweight npm library to convert currency values into words.
Downloads
17
Maintainers
Readme
currency-in-word
currency-in-word
is a lightweight npm library that converts numerical currency values into their corresponding word representations. It's useful for generating invoices, legal documents, or any scenario where a textual representation of currency is required.
Features
- Converts any currency amount into words.
- Supports various currency formats.
- Lightweight and easy to integrate.
- Customizable for different use cases.
Installation
npm install currency-in-word
Usage
import { currencyInWords } from 'currency-in-word';
const amount = 1234.56;
const currency = "US";
const fallBackCurrency = "US";
const result = currencyInWords(amount, currency, fallBackCurrency);
console.log(result); // Outputs: "One thousand two hundred thirty-four dollars and fifty-six cents"
Customization
You can customize the output format or even add your own currency symbols and denominations.
Contributing
Feel free to open issues or pull requests for any bugs, features, or suggestions!