parsing - PHP: unformat money -
is there way float value of string this: 75,25 €
, other parsefloat(str_replace(',', '.', $var))
?
i want dependent on current site language, , comma replaced dot.
you can use
example manual:
$formatter = new numberformatter('de_de', numberformatter::currency); var_dump($formatter->parsecurrency("75,25 €", $curr));
gives: float(75.25)
note intl extension not enabled default. please refer installation instructions.
Comments
Post a Comment