Welcome to the Cookbook

loading...

7.6.2 precision

Er is geen nog vertaling vertaling voor deze rubriek. Help ons en vertaal dit.. Meer informatie over vertalingen

precision (mixed $number, int $precision = 3)

This method displays a number with the specified amount of precision (decimal places). It will round in order to maintain the level of precision defined.

<?php echo $number->precision(456.91873645, 2 ); ?>
 
//Outputs: 
456.92
  1. <?php echo $number->precision(456.91873645, 2 ); ?>
  2. //Outputs:
  3. 456.92