1.0.3 • Published 10 years ago
jj-npm-price-formatting v1.0.3
jj-npm-price-formatting
Localized formatting of price strings
Installation
$ npm install jj-npm-price-formattingAPI
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.3Changed DK NO SE currencies, added BEFL BEFR CHFR