Provide the number of decimal places to round to: : round « Math « PHP






Provide the number of decimal places to round to:

 
<?
    $a = round(4.4999); // 4
    $b = round(4.123456, 3); // 4.123
    $c = round(4.12345, 4); // 4.1235
    $d = round(1000 / 160); // 6
?>
  
  








Related examples in the same category

1.round a double
2.float round ( float num [, int precision] ) rounds parameter to the nearest integer to its current value