round to nearest 2 digits in php code example Example: php round nearest half $x = floor($x * 2) / 2;