refactoring
This commit is contained in:
+1
-1
@@ -233,7 +233,7 @@ function public.bounded(lower_bound, upper_bound, number)
|
||||
return max(lower_bound, min(upper_bound, number))
|
||||
end
|
||||
|
||||
function public.round(x) return floor(x + 0.5) end
|
||||
function public.round(x) return floor(x + .5) end
|
||||
|
||||
function public.later(t0, t)
|
||||
return function() return GetTime() - t0 > t end
|
||||
|
||||
+4
-4
@@ -264,7 +264,7 @@ end
|
||||
|
||||
function parse_parameter(input_type, str)
|
||||
if input_type == 'money' then
|
||||
local money = money.from_string(str)
|
||||
local money = aux.money.from_string(str)
|
||||
return money and money > 0 and money or nil
|
||||
elseif input_type == 'number' then
|
||||
local number = tonumber(str)
|
||||
@@ -426,8 +426,8 @@ function public.query_string(components)
|
||||
elseif component[1] == 'filter' then
|
||||
query_builder.append(component[2])
|
||||
for parameter in present(component[3]) do
|
||||
if filter.filters[component[2]].input_type == 'money' then
|
||||
parameter = money.to_string(money.from_string(parameter), nil, true, nil, nil, true)
|
||||
if aux.filter_util.filters[component[2]].input_type == 'money' then
|
||||
parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, nil, true)
|
||||
end
|
||||
query_builder.append(parameter)
|
||||
end
|
||||
@@ -464,7 +464,7 @@ function prettified_query_string(components)
|
||||
prettified.append(info.display_name(aux.cache.item_id(parameter)) or color.label.enabled('['..parameter..']'))
|
||||
else
|
||||
if filters[component[2]].input_type == 'money' then
|
||||
prettified.append(money.to_string(money.from_string(parameter), nil, true, nil, gui.inline_color.label.enabled))
|
||||
prettified.append(aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, gui.inline_color.label.enabled))
|
||||
else
|
||||
prettified.append(color.label.enabled(parameter))
|
||||
end
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ function public.to_string2(money, exact, color)
|
||||
|
||||
if not exact and money >= 10000 then
|
||||
-- Round to nearest silver
|
||||
money = floor(money / 100 + 0.5) * 100
|
||||
money = floor(money / 100 + .5) * 100
|
||||
end
|
||||
local g, s, c = to_gsc(money)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user