I am using Globalize for jQuery and am searching for a solution to convert number with currency to a number without the currency symbol.
Globalize has a function Globalize.currencyParser, but in v1.1.1
its still empty, so I tried to convert with
Globalize(“fr”).numberParser()(“-10 000,99 €”)
but it became 10000,99
and not -10000,99
.
In function numberParse
if ( prefix === negativePrefix && suffix === negativeSuffix ) { number *= -1; }
the number will not convert to negative, because suffix !== negativeSuffix. So, I decided to solve my problem with a regex
( /^([^0-9]*)(([0-9,\'\٬\.\s]*[0-9]+)(,٫\.[0-9]+)?)([^0-9]*)$/ )
but I'd prefer a solution with Globalize.currencyParser. Thoughts?