Content deleted Content added
remove two unused variables; values[i].string cannot be nil; fix logic for parameter 'imperial first' (it's not documented but this change means '|imperial first=no' would give false) |
fix my mistake with 'checkFlag(...) or checkFlag(...)' (false or true is true); fix similar potential problem with checkFlag usage; finish removing unused variable |
||
Line 60:
Value.__index = Value
local function checkFlag( flag, default )
if flag == nil then
return
elseif type( flag ) == 'boolean' then
return flag
Line 271:
local color_scheme = frame.args.color_scheme or 't'
local scale_factor = math_mod._cleanNumber( frame.args.scale_factor) or 1
local date_mode = checkFlag( frame.args.date_mode
local label = frame.args.label or ''
local annual_mode = (frame.args.annual_mode or 'avg'):lower()
local include_space = checkFlag( frame.args.include_space
local second_line = checkFlag( frame.args.second_line, false )
local prefer_cm = checkFlag( frame.args.prefer_cm, false )
local pframe = frame:getParent()
local imperial_first = checkFlag( frame.args['imperial first']
local metric_first = checkFlag( frame.args['metric first']
local single_line = checkFlag( frame.args['single line']
if imperial_first == nil then
Line 354:
end
return makeLine( label, first_values, second_values, color_values
end
|