Jump to content

Limiting decimal length


Praetorian

Recommended Posts

//round($number, $decimalplaces);//For example$number = 2.019943234;echo round($number, 2); //Will echo 2.02

Link to comment
Share on other sites

Or

$number = 2.019943234;$number *= 100;$number = floor($number);$number /= 100;echo $number; //Will echo 2.01

:)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...