Home › Forums › Back End › how to convert float to this › Re: how to convert float to this
January 9, 2013 at 5:45 am
#120374
Member
This can be reduced to a single operation by passing a 2nd argument to the round() function.
$x = 12.548544444;
$x = round($x, 2);
The “2” tells it to round two places past the decimal.