我不知道如何转换数字。
number_format()
没有帮助我。
这就是我想要做的......
from 1 to 0,01
from 12 to 0,12
from 1234 to 12,34
from 12345 to 123,45
from 123456 to 1.234,56
from 1000000 to 10.000,00
from 123456789 to 1.234.567,89
etc.
谢谢:)
答案 0 :(得分:4)
首先除以100
,然后您可以使用number_format
:
$number = 1;
echo number_format($number / 100, 2, ",", "."); // 2 decimals, "," and "." as seperators
// gives 0,01