@horacebury: thanks mate! I didn’t think about a string function, since i am dealing with floats… [import]uid: 90610 topic_id: 27401 reply_id: 111334[/import]
Try this, I think it’ll give you what you’re ultimately looking for:
[lua]local a = 12.3456778
local b = string.format("%.2f", a)
local c = tonumber( b )
local d = c + 1.0
print(d)[/lua]
Basically, takes your original number, trims the decimal places, then continues using it as a number in numeric calculations. [import]uid: 8271 topic_id: 27401 reply_id: 111337[/import]