I'm have this number
55550
But I it should be 555.50, I tried number_format() and sprinft but did not work.
Any idea? Thanks!
I'm have this number
55550
But I it should be 555.50, I tried number_format() and sprinft but did not work.
Any idea? Thanks!
<?php
$num = 55550;
$num = (float) $num / 100;
echo number_format($num, 2, ".", "");
by casting the number to float, and dividing by 100 you can use number_format to change the format.