fix for or filter

This commit is contained in:
Manuel Simon Hirsig
2016-02-04 03:38:48 +01:00
parent 2e6a888f0e
commit 9503daceb1
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -143,7 +143,7 @@ function private.median(list)
if getn(list) == 0 then
return
end
local middle = (getn(list) + 1) / 2
return (list[floor(middle)] + list[ceil(middle)]) / 2
end
@@ -160,7 +160,7 @@ function private.push_data()
local daily_market_value = private.daily_market_value(item_record.histogram)
private.balanced_list_insert(item_record.balanced_list, daily_market_value, 7)
private.balanced_list_insert(item_record.balanced_list, Aux.round(daily_market_value), 9)
item_record.day_count = item_record.day_count + 1
item_record.histogram = {}
+4 -2
View File
@@ -293,9 +293,11 @@ function m.validator(filter)
for i=getn(filter.tooltip),1,-1 do
local op = strupper(filter.tooltip[i])
if op == 'AND' then
tinsert(stack, tremove(stack) and tremove(stack))
local a, b = tremove(stack), tremove(stack)
tinsert(stack, a and b)
elseif op == 'OR' then
tinsert(stack, tremove(stack) or tremove(stack))
local a, b = tremove(stack), tremove(stack)
tinsert(stack, a or b)
elseif op == 'NOT' then
tinsert(stack, not tremove(stack))
elseif op ~= 'TT' then