Stormworks: Build and Rescue

Stormworks: Build and Rescue

re1duh Oct 15, 2021 @ 1:47pm
math.floor lua help
i need to know how to properly use math.floor while using something like screen.drawText(2,2,rpm) and how can i use it so i dont have decimals.
Last edited by re1duh; Oct 15, 2021 @ 1:48pm
< >
Showing 1-3 of 3 comments
GMC Oct 15, 2021 @ 3:39pm 
Use string.format("%d", rpm) to convert rpm to a string with no decimals.

ElfBossHogg Oct 15, 2021 @ 4:01pm 
If you want to use math.floor what you do is multiply the number by 10^n where n is the number of decimal places you want and then after mathfloor divide by the same number.

ex. 2 decimal places...
math.floor(6.565657575x100)/100 = 6.56
re1duh Oct 15, 2021 @ 4:12pm 
thanks
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Oct 15, 2021 @ 1:47pm
Posts: 3