1.1.6 • Published 3 years ago

@prepair/parse-price v1.1.6

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

parse-price

Parse price text into currency and value.

"US$238.27"  --> { currencyCode: 'USD', value: 238.27 }
"221,81 €"   --> { currencyCode: 'EUR', value: 221.81 }
  • Supported currencies: AED, BAM, BGN, CHF, CZK, DKK, EUR, GBP, GEL, HRK, HUF, ILS, LVL, MKD, NOK, PLN, RON, RSD, RUB, SEK, UAH, USD
  • Will not be supported: BHD, IQD, JOD, KWD, LYD, OMR, TND
  • Exact list may be found in locale-support package.

installation

npm i -S @prepair/parse-price

Requires node v6+ context.

usage

const parsePrice = require('@prepair/parse-price');

console.log(parsePrice('MKD12,955.86'));

development

Do not forget to npm run build, or set it up in the CI.

1.1.6

3 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago