Posted 21 April 2017 - 02:11 PM
im a little lost in my lua programming, not done it for quite some time now, and forgotten half of it :D/>
im making yet another power monitor/reactor controller
this time im trying to draw some power bars on the screen.
but i want to make each "dot" of the bar a 5% increment.
I know how to do the math of it.
But my question is..
How do you get math.ceil to round up to each 5, instead of each full number?
ex math.ceil( 10 / 4 ) – this gives 2.5. normally it would be rounded to 3,
but if i want it rounded to 5 instead.. how do i do that?
im making yet another power monitor/reactor controller
this time im trying to draw some power bars on the screen.
but i want to make each "dot" of the bar a 5% increment.
I know how to do the math of it.
But my question is..
How do you get math.ceil to round up to each 5, instead of each full number?
ex math.ceil( 10 / 4 ) – this gives 2.5. normally it would be rounded to 3,
but if i want it rounded to 5 instead.. how do i do that?