Oihana PHP

roundValue.php

Table of Contents

Functions

roundValue()  : int|float
Rounds and returns the rounded value of the specified number or expression.

Functions

roundValue()

Rounds and returns the rounded value of the specified number or expression.

roundValue(int|float $value[, int $floatCount = 0 ]) : int|float
Parameters
$value : int|float

The number to round.

$floatCount : int = 0

The number of decimal places to round to.

Tags
example
echo roundValue(4.9876);       // Outputs: 5
echo roundValue(4.9876, 2);    // Outputs: 4.99
echo roundValue(4.1234, 3);    // Outputs: 4.123
author

Marc Alcaraz (ekameleon)

since
1.0.0
Return values
int|float

The rounded number.


        
On this page

Search results