mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 15:46:56 +00:00
8891a1df44
This commit breaks alot of compatibility and maybe other things too. The change was necessary, because the old framework ran up against its limits. A lot of new configuration options are now possible and some of them were already added.
25 lines
609 B
Lua
25 lines
609 B
Lua
-- a real "round" instead of ceil or floor
|
|
function round(input, places)
|
|
if not places then places = 0 end
|
|
if type(input) == "number" and type(places) == "number" then
|
|
local pow = 1
|
|
for i = 1, places do pow = pow * 10 end
|
|
return floor(input * pow + 0.5) / pow
|
|
end
|
|
end
|
|
|
|
function strsplit(delimiter, subject)
|
|
local ret = {}
|
|
local sector = subject
|
|
while true do
|
|
local pos = strfind(sector, delimiter)
|
|
if pos then
|
|
table.insert(ret, strsub(sector,1,pos-1))
|
|
sector = strsub(sector,pos+1)
|
|
else
|
|
table.insert(ret, sector)
|
|
return unpack(ret)
|
|
end
|
|
end
|
|
end
|