extract-price icon indicating copy to clipboard operation
extract-price copied to clipboard

parse result empty for 1 222 333,50

Open leadscloud opened this issue 5 years ago • 2 comments

do you have test these ?

extractPrice('and space followed by "," notation 1 222 333,50');
// [{amount: 122233350}]

extractPrice('and space followed by "." notation 1 222 333.50');
// [{amount: 122233350}]

extractPrice('extracts multiple prices listed anywhere within the string using different formats: 1,22, 222, 3,22, 4.20, 5.666');
// [{amount: 12200}, {amount: 22200}, {amount: 322}, {amount: 422}, {amount: 566600}]

why i got [], with 1 222 333,50

leadscloud avatar Sep 17 '20 14:09 leadscloud

It was not designed to support numbers that include spaces in them, but this can be added.

gajus avatar Sep 17 '20 16:09 gajus

what about stripping spaces before parsing?

dgtlmoon avatar Dec 08 '22 09:12 dgtlmoon