php - How could i show only one digit after floating point -
$f = sprintf ("%.1f",$per); echo "you hit".$f."
by code can show 1 digit after floating point.but when result 100%,then shows 100.0%. want show 100%. how this????
$per = 100; $f = sprintf ("%.1f",$per); $rounded = round($f, 1); echo $rounded;
Comments
Post a Comment