例如,我有一个号码123457
。我要这个:1234.57
我已经尝试过format_number
,round()
等等,但它不起作用。
我怎样才能做到这一点?
If you want to make sure you don't get weird results from a bare division like $number / 100
, you could use sprintf()
to format it:
echo sprintf('%.2f', $number / 100);