0.0.4 • Published 3 years ago

foramount v0.0.4

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

ForAmount ₹$

ForAmount is a npm package which can be used to format and display amount according to your language set. Is more powerful when localizing your website, hence displaying cost according to the language and country selected.

View the live demo

How to use:

As a React Component

import Formatter from "foramount";

Example in react:

<Formatter amount="200000" currency="INR" locale="en-IN" />

In NodeJS

const formatter = require("foramount");

Example in NodeJS:

formatter({amount: "200", currency: "INR" locale: "en-IN" });

Props:

PropsValuesDescription
amount10000Pass the amount to be formatted here
currencyISO 4217 code from https://en.wikipedia.org/wiki/ISO_4217#Active_codes eg: INR, USD, IDRIf left blank, currency unit will not be displayed.
currencyDisplayeg: symbol, narrowSymbol, code, namewill display currency unit for the amount set, default is code
localeeg: en-US, en-IN, hi-INIs a combination of language code and country code, default is en-US