lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


math.floor(x+0.5)

2016-07-29 10:06 GMT+02:00 涵曦 <hanxi.info@gmail.com>:
> Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio
>> 100000*1.005
> 100500.0
>> math.floor(100000*1.005)
> 100499
>
> I want a function like math.round.
>
>> math.round(100000*1.005)
> 100500
>
> Have some good idea?