Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
python like round function in lua
print(_VERSION) print() -- simple round (like in python) function local function round(n, m) -- return n with m digits after '.', m should be between 0 and 100 i think return math.floor(n*10^m)/10^m end for i = 0, 9 do print(i, round(0.123456789, i)) end -- i know about n.0 -- i dont know what to do about that print() print(round(0, 0), round(1, 0))
run
|
edit
|
history
|
help
0
multiline string
Eliminatoria minigame
Key
10 Line challenge
finding volume of pyramids (for me, but feel free to use)
cases
Reverse strings function - Lua
Monty Hall
Dirty Bag 'o Tokens Maker
Conta valores acima da média - LUA