3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function twodecimals($number, $afterDot = 2){ return floor($number * pow(10, $afterDot) + 0.00001) / pow(10, $afterDot); } echo twodecimals(18.9999);
Output for 4.3.0 - 7.1.0
18.99