1.0.3 • Published 8 years ago

jj-npm-price-formatting v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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 for
  • price (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