mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Changed lume.trace() to round numbers to 2 decimal places
This commit is contained in:
parent
9bf2d24ee2
commit
e6246834b7
6
lume.lua
6
lume.lua
@ -308,9 +308,13 @@ end
|
||||
|
||||
|
||||
function lume.trace(...)
|
||||
local function stringify(x)
|
||||
x = (type(x) == "number") and lume.round(x, .01) or x
|
||||
return tostring(x)
|
||||
end
|
||||
local info = debug.getinfo(2, "Sl")
|
||||
local head = "[" .. info.short_src .. ":" .. info.currentline .. "] "
|
||||
print(head .. table.concat(lume.map({...}, tostring), " "))
|
||||
print(head .. table.concat(lume.map({...}, stringify), " "))
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user