I want to chunk large numbers. For example.
//between each three decimals a dot should be placed
33 thousand like this 33.000
33 milion like this 33.000.000
How can I do this in php?
Use number_format()
:
number_format(
$number,
0, //amount of decimal points
',', //decimal seperator
'.' //thousands seperator
);
Here is an example:
number_format("33000",0,"",".");
number_format("33000000",0,"",".");