Rounds a value to a specified number of decimal places.
Syntax
Result = SRP_Math("ROUND", Value1, Value2, DecimalPlaces, ScientificNotation)
Returns
Value1 round to the Value2 places.
Remarks
The ROUND operation rounds Value1 to the number of decimal places specified in Value2. This provides a more shorthand way of rounding than using the NONE operation. For instance, rounding PI to 5 places using NONE looks like this:
Result = SRP_Math("NONE", "3.1415926535897932384626433832795", "", 5)
Whereas, using ROUND looks like this:
Result = SRP_Math("ROUND", "3.1415926535897932384626433832795", 5)
It's a minor difference to be sure, but using ROUND is arguably more readable.
Example
// Round PI to 5 decimal places Val = "3.1415926535897932384626433832795" Result = SRP_Math("ROUND", Val, 5) !! Result = 3.14159 !!
// Round PI to 4 decimal places Val = "3.1415926535897932384626433832795" Result = SRP_Math("ROUND", Val, 4) !! Result = 3.1416 !!