nekromoff / layouter

Simple grid layout library for LÖVE engine (Love2D).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

math.round does not exist.

Lightnet opened this issue · comments

I check the doc that function does not exist for love2D. Unless I am wrong.

Ah, good catch. Sorry about that, I have this function in my helpers.lua file and use it widely.

I'll add it to layouter, but in the meantime you can just add this yourself:

function math.round(num, numDecimalPlaces)
    local mult = 10 ^ (numDecimalPlaces or 0)
    return math.floor(num * mult + 0.5) / mult
end