0

我有这样的代码:

    $options = array(
                    'number_format' => '#.##'
            );
    $value = '22155000000000000048';
    $result = Zend_Locale_Format::getNumber($value, $options);
    var_dump($result);

接收:22155000000000000048

假设:22155000000000000048.00

甚至'number_format' => '#.00'没有帮助

4

1 回答 1

0

使用 toNumber() 而不是 getNumber()。正确的格式是 '#0.00'

$options = array(
                'number_format' => '#0.00'
        );
$value = '22155000000000000048';
$result = Zend_Locale_Format::toNumber($value, $options);
var_dump($result);
于 2012-08-10T16:02:56.670 回答