Closed birdy247 closed 1 year ago
Can you provide example code that reproduces this? Also, which version are you using?
I'd consider upgrading PHP, just btw, at least to the latest version 7 or maybe even 8.
`
$currencies = new ISOCurrencies();
$numberFormatter = new \NumberFormatter('en_GB', \NumberFormatter::CURRENCY);
$moneyParser = new IntlMoneyParser($numberFormatter, $currencies);
$money = $moneyParser->parse($value);
return $money->getAmount();
`
version: 3.2.1
@UlrichEckhardt Just checking you saw this. Any ideas (other than the PHP version)? Thanks in advance
Oh, yes, saw it but slipped underneath the radar again... Just for completeness, can you set the value of $value
in your code snippet?
Also, the NumberFormatter
, how would that format the numeric value you're expecting as a result from parsing? The idea is to turn the process around, just to rule out that the input does not have the format expected by the parser.
PHP 7.2, no support anymore.
When trying to parse S$10.00 We receive this error
Upon investigation it appears to fail on line 49 on the IntlMoneyParser.php because the PHP NumberFormatter returns false i.e. its unable to parse it to a decimal.
PHP 7.2
Any ideas?