I've noticed that rounding checks which multiple it's closes to when using two variable
round(A,B)
ex: round(3,3.5) returns 3.5
or- round(7.999,4) returns 4
This also happens when a negative integer is entered for B.
ex: round(3,-3.5) returns 3.5
or- round(7.999,-4) returns 8
I was wondering if it would be possible to change the behavior so that a negative integer for B would always round down.
ex: round(3.4999, -3.5) returns 0
or- round(7.999,-4) returns 4
Let me know what you think, or perhaps maybe an additional variable could be added:
round(A, B=1, C=0)
A: The variable to be rounded
B: The multiple to round towards. Default is 1
C: How the variable is rounded.
0= normal
-1= always round down
1= always round up
ID:115255
Jun 30 2011, 5:22 pm
|
|||||||
Not Feasible
| |||||||
This change could break existing games.