2.1.1 • Published 2 years ago

price-extractor v2.1.1

Weekly downloads
112
License
GPL-3.0
Repository
github
Last release
2 years ago

Npm Version node Build status Test Coverage Maintainability Known Vulnerabilities

price-extractor

A small library for parsing price strings in order to extract the price as a number and the currency code of the price.
The library can handle all kinds of thousands and cents delimiters, as well as all currency native symbols and unicodes.

Installation

npm install price-extractor

Or

yarn add price-extractor

Examples

import {searchPriceAndCode} from 'price-extractor';
console.dir(searchPriceAndCode('99,01€')); // { price: 99.01, code: 'EUR' }
console.dir(searchPriceAndCode('ARS 1,647.86')); // { price: 1647.86, code: 'ARS' }
console.dir(searchPriceAndCode('1.958,43 NOK')); // { price: 1958.43, code: 'NOK' }
console.dir(searchPriceAndCode('¥732.62')); // { price: 732.62, code: 'JPY' }
console.dir(searchPriceAndCode('2\'425.64 CHF')); // { price: 2425.64, code: 'CHF' }
2.1.1

2 years ago

2.1.0

3 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.1

5 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago