格式化数字字符串

<?php

//格式化数字字符串

$a = 123456789;
$b = number_format($a);
echo $b;
echo '<br />';

$a = 1234.56789;
$b = number_format($a,2);
echo $b;
echo '<br />';

$a = 123456789;
$b = number_format($a,3);
echo $b;
echo '<br />';

$a = 123456789;
$b = number_format($a,2,'/',':');
echo $b;
echo '<br />';

?>

你可能感兴趣的:(PHP,格式化数字字符串)