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