Reputation: 2096
I have a variable
<?php $number = "10000000"; ?>
I want convert a string to string number with dotted seperator like this: 10000000 -> 10.000.000
What can i do now? Thanks.
Upvotes: 1
Views: 159
Reputation: 1675
The number_format()
function formats a number with grouped thousands. For the dotted separator simply use '.'
as the fourth argument:
echo number_format("10000000", 0, ",", "."); //10.000.000
Upvotes: 3