Round value

Hi
I have some values and i need to round it, i am getting values like:
0.54676764…
i need to round it to two decimal places, in this case:
0,55
and then round to
55

How can i do it?

Thanks [import]uid: 26056 topic_id: 22220 reply_id: 322220[/import]

This should do the trick.

[lua]local highPrecision = 0.54676764
local lowPrecision = math.round(highPrecision * 100)[/lua] [import]uid: 14598 topic_id: 22220 reply_id: 88486[/import]

yeh is really it, thanks :slight_smile: [import]uid: 26056 topic_id: 22220 reply_id: 88494[/import]

yeh is really it, thanks :slight_smile: [import]uid: 26056 topic_id: 22220 reply_id: 88495[/import]

Actually…

local highPrecision = 0.54676764  
local lowPrecision = math.round(highPrecision \* 100) / 100  

without the extra / 100, you end up with lowPrecision = 55

[import]uid: 19626 topic_id: 22220 reply_id: 88526[/import]