Function __global->round

Definitions

sources_custom/phpstub.php

  • Rounds a float.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: float

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$val float No No required parameter N/A N/A Value to round
$precision integer No No 0 N/A N/A Number of decimal points of precision required (-ve allowed)
$mode integer No No 1 N/A N/A Rounding mode, a PHP_ROUND_* constant

Returns

  • Rounded value
  • Type: float
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Rounds a float.
 *
 * @param  float $val Value to round
 * @param  integer $precision Number of decimal points of precision required (-ve allowed)
 * @param  integer $mode Rounding mode, a PHP_ROUND_* constant
 * @return float Rounded value
 */

function round(float $val, int $precision = 0, int $mode = 1) : float