Changes

m
no edit summary
Line 187: Line 187:  
local function formatAmount(n, time, reset)
 
local function formatAmount(n, time, reset)
 
   n = tonumber(n)
 
   n = tonumber(n)
 +
  if n == 0 then
 +
    return ''
 +
  end
 
   local r = not n and '??' or tostring(time and U.round(60 * n / time) or n)
 
   local r = not n and '??' or tostring(time and U.round(60 * n / time) or n)
 
   return time and reset == 1 and string.format('<span style="color:grey">%s</span>', r) or r
 
   return time and reset == 1 and string.format('<span style="color:grey">%s</span>', r) or r
Line 235: Line 238:  
     item1 = e.win_item1[1] > 0 and formatItem(e.win_item1[1], e.win_item1[2]) or '',
 
     item1 = e.win_item1[1] > 0 and formatItem(e.win_item1[1], e.win_item1[2]) or '',
 
     item2 = e.win_item2[1] > 0 and formatItem(e.win_item2[1], e.win_item2[2]) or '',
 
     item2 = e.win_item2[1] > 0 and formatItem(e.win_item2[1], e.win_item2[2]) or '',
     sum = args.explicit[id .. ' sum'] or '??',
+
     sum = formatAmount(args.explicit[id .. ' sum']),
     level = args.explicit[id .. ' level'] or '??',
+
     level = formatAmount(args.explicit[id .. ' level']),
 
     fleet = (e.reset_type == 1 and 'Monthly expedtion<br>' or '') .. (e.damage_type == 1 and 'Reduces HP<br>' or '') .. (args.explicit[id .. ' fleet'] or '??') .. string.format('<br>Eg %s', formatSampleFleet(e.sample_fleet)),
 
     fleet = (e.reset_type == 1 and 'Monthly expedtion<br>' or '') .. (e.damage_type == 1 and 'Reduces HP<br>' or '') .. (args.explicit[id .. ' fleet'] or '??') .. string.format('<br>Eg %s', formatSampleFleet(e.sample_fleet)),
     drums = args.explicit[id .. ' drums'] or '??',
+
     drums = formatAmount(args.explicit[id .. ' drums']),
 
     fuel_cost = e.use_fuel > 0 and '-' .. 10 * e.use_fuel or '',
 
     fuel_cost = e.use_fuel > 0 and '-' .. 10 * e.use_fuel or '',
 
     ammo_cost = e.use_bull > 0 and '-' .. 10 * e.use_bull or '',
 
     ammo_cost = e.use_bull > 0 and '-' .. 10 * e.use_bull or '',
cssedit, gkautomate
7,064

edits