Search code examples
luafloor

How to math.floor to a decimal in Lua?


print(math.floor(12.5928))

The code above prints 12. What do you do to make it print 12.5?


Solution

  • print(math.floor(12.5928 * 10) / 10)