0
<?php
$fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL );
$num = "1 234 567,891";
echo $fmt->parse($num)."\n";
echo $fmt->parse($num, NumberFormatter::TYPE_INT32)."\n";
?>

It is returning only the first character i.e, 1 . Expected output is 1234567.89

4

1 回答 1

0

对我来说,它输出1234567.891-1234567所以它按预期工作。但是,根据PHP 手册中的注释,这取决于使用的版本。

另一种猜测是在1 234 567,891中有效fr_FR,但在 中无效de_DE

于 2014-06-09T22:49:26.990 回答