price-parser
TypeScript icon, indicating that this package has built-in type declarations

3.4.0 • Public • Published
const priceParser = require('price-parser');
 
priceParser.parseFirst('31 june: only £ 54 each — 1 time offer!');
// { value: 5400, floatValue: 54, symbol: '£', currencyCode: 'gbp' }
// Note: values are in smallest currency unit
 
priceParser.parseAll('Was £5.99, now £2.99',);
// [
//   { value: 599, floatValue: 5.99, symbol: '£', currencyCode: 'gbp' },
//   { value: 299, floatValue: 2.99, symbol: '£', currencyCode: 'gbp' },
// ]

Readme

Keywords

none

Package Sidebar

Install

npm i price-parser

Weekly Downloads

2

Version

3.4.0

License

ISC

Unpacked Size

54.7 kB

Total Files

9

Last publish

Collaborators

  • danielolaviobr
  • hyuko21
  • dleibner
  • mihon
  • khard
  • inca
  • randunel
  • alisapsee
  • nicck
  • andrew-waters
  • anatoliy
  • mgubio