ID:1127849
 
(See the best response by Super Saiyan X.)
I want to do a calculation like this:

8 / 5 = 1.6

But I want the result to be 1, dropping everything after the decimal.

How can I do this?
Best response
round(x, 1)

round(x) should work, it's a floor function.
Rounding up? use round()

or if you wanna parse :D

proc/dec2dig()
.="[args[1]]"
if(findtext(.,"."))return text2num(copytext(.,1,findtext(.,".")))
In response to Kozuma3
Kozuma3 wrote:
Rounding up? use round()

or if you wanna parse :D

BYOND's round() function automatically rounds down. It's a floor function.
In response to Super Saiyan X
Super Saiyan X wrote:
Kozuma3 wrote:
Rounding up? use round()

or if you wanna parse :D

BYOND's round() function automatically rounds down. It's a floor function.

I never noticed that :o
I ended up parsing at first, and then switching to just using round() haha.

Thanks.