ID:175320
 
I notice that the round() procedure in byond ALWAYS rounds down, even on numbers such as 7.8 and 7.5, numbers that should be rounded up to 8. Is there a way to fix this? It really buggers things up when you want to go from one number to another.

Example:

- number X = 5
- procedure used: X = round(X*1.5)
- what it should be: X = 5*1.5 = 7.5 = 8 when rounded

but byond computes it as 7. Everything is rounded down.

Is there another way to do this properly, like do a % increase? 5 + 50%(of 5) would still be 7.5 though. How is this solved?

-Dagolar
Look up round() in the DM help. The first number is the number you want to round. The second number is the value you want to round it off to. If you omit the second number, then it truncates the number (cuts off the decimal part). If you want 7.4 to round to 7, and 7.5 to round to 8, then you can just do round(number,1).