Returns a number rounded to a specified number of decimal places.
Round ( expression [, decimalplaces] )
Parameters
expression | Any valid numeric expression. |
decimalplaces | [optional] Number indicating how many places to the right of the decimal are included in the rounding. If omitted, Round returns an integer. |
Return Value
Returns rounded number.
Remarks
The decimalplaces parameter can be negative which allows you to round to the ones, tens, hundred, etc. place. Note that up to fifteen digits of a number are displayed, and note that decimalplaces will never pad a number with trailing zeros.
Related
Int, Number
Example
$x = Round(-1.582, 1) ;returns -1.6
$y = Round(3.1415, 9) ;no change
$z = round(123.5, -1) ;returns 120