Welcome to the Cookbook

loading...

7.6.2 precision

There is no translation yet for this section. Please help out and translate this.. More information about translations

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