Hi,
Either amend the current Round() function or provide a new function RoundTo().
The new/amended function will allow rounding to a number of decimal places - not just a straight integer round up.
Eg.
value = 21.1234
Round(value, 2) result = 21.12
Round(value, 3) result = 21.123
Round(value) result = 21
RoundTo()
RoundTo()
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
Re: RoundTo()
Try adding this one line to your script:
---
Function p_RoundTo(StartValue, DecimalPlaces) Return(Round(StartValue*10^DecimalPlaces)/10^DecimalPlaces) EndFunction
---
Now if value = 21.1234
p_RoundTo(value, 2) will give you 21.12
p_RoundTo(value, 3) will give you 21.123
p_RoundTo(value) will give you 21
---
Function p_RoundTo(StartValue, DecimalPlaces) Return(Round(StartValue*10^DecimalPlaces)/10^DecimalPlaces) EndFunction
---
Now if value = 21.1234
p_RoundTo(value, 2) will give you 21.12
p_RoundTo(value, 3) will give you 21.123
p_RoundTo(value) will give you 21