tusharjo / foramount

ForAmount is a npm package which can be used to format and display amount according to your language set in your react or nodeJS app.

Home Page:https://www.npmjs.com/package/foramount

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.


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:


Props Values Description
amount 10000 Pass the amount to be formatted here
currency ISO 4217 code from https://en.wikipedia.org/wiki/ISO_4217#Active_codes
eg: INR, USD, IDR
If left blank, currency unit will not be displayed.
currencyDisplay eg: symbol, narrowSymbol, code, name will display currency unit for the amount set, default is code
locale eg: en-US, en-IN, hi-IN Is a combination of language code and country code, default is en-US

About

ForAmount is a npm package which can be used to format and display amount according to your language set in your react or nodeJS app.

https://www.npmjs.com/package/foramount


Languages

Language:JavaScript 100.0%