mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Lua 5.3 compatibility fixes
This commit is contained in:
parent
f7b3eb64bb
commit
5305cb34c8
6
lume.lua
6
lume.lua
@ -16,7 +16,7 @@ local math_floor = math.floor
|
||||
local math_ceil = math.ceil
|
||||
local math_random = math.random
|
||||
local math_cos = math.cos
|
||||
local math_atan2 = math.atan2
|
||||
local math_atan2 = math.atan2 or math.atan
|
||||
local math_sqrt = math.sqrt
|
||||
local math_abs = math.abs
|
||||
local math_pi = math.pi
|
||||
@ -520,7 +520,9 @@ function lume.trace(...)
|
||||
local t = { "[" .. info.short_src .. ":" .. info.currentline .. "]" }
|
||||
for i = 1, select("#", ...) do
|
||||
local x = select(i, ...)
|
||||
x = (type(x) == "number") and lume.round(x, .01) or (x or "nil")
|
||||
if type(x) == "number" then
|
||||
x = string.format("%g", lume.round(x, .01))
|
||||
end
|
||||
t[#t + 1] = tostring(x)
|
||||
end
|
||||
print(table.concat(t, " "))
|
||||
|
Loading…
Reference in New Issue
Block a user