Open mkmarq opened 3 years ago
when i did it it seem right... but now at distance i don't like it either.
Direct replacement for litreParse that I think addresses the problem:
function litreParse(litre, total)
return getValueWithUnits(litre) .. "/" .. getValueWithUnits(total)
end
function getValueWithUnits(value)
local size = ""
if value < 1000 then
size = "L"
elseif value < 1000000 then
value = value / 1000
size = "kL"
else
value = value / 1000000
size = "kt"
end
return string.format("%.1f",value)..size
end
Hope it's useful :)
Need to show units on the current amount for clarity.
For example, right now if I see 54.0/192.0kL, it is impossible to tell from the numbers alone whether it means 54L or 54kL.