jj-npm-price-formatting
v1.0.3
Published
NPM package to obtain localized price strings
Downloads
6
Readme
jj-npm-price-formatting
Localized formatting of price strings
Installation
$ npm install jj-npm-price-formatting
API
getPriceString (market, price)
Returns a price string matching the conventions of the specified market.
market (String)
The market we want to parse the price forprice (Number)
The price we want to localize
Example
var priceFormatting = require('./node_modules/jj-npm-price-formatting/dist/');
priceFormatting.getPriceString('DK',179.95) -> '179,95 DKK'
priceFormatting.getPriceString('DK',179) -> '179,- DKK'
Notes
- Automatically rounds prices, as in the example above
License
MIT
Version log
1.0.3
Changed DK NO SE currencies, added BEFL BEFR CHFR