How Do I Make A Number Like: 0.45 Become: 45% ? I Know This Has To Be Simple.
Im Guessing: (GhetTo)
$num = 0.45; $num = str_replace("0.", "", "$num"); $num = "$num%";
Eh? Or Is There A Function For It? Becuase That Wont Work For: 0.07 (7%)
$num = 0.07123985; $num = round($num, 2); $explode = explode('.', $num); $num = str_replace('0', '', $explode[1]); echo $num . '%';
A little shorter:
$num = 0.07123985; $perc = round($num * 100); echo $perc . '%';