Commit cf2900e5 authored by Blazeflack's avatar Blazeflack

Changed no-decimal tags to display decimals when going above 1 million.

parent 90643a09
......@@ -49,9 +49,9 @@ local function ShortValue(number, noDecimal)
shortValueFormat = (noDecimal and "%.0f%s" or "%.1f%s")
if E.db.general.numberPrefixStyle == "METRIC" then
if abs(number) >= 1e9 then
return format(shortValueFormat, number / 1e9, "G")
return format("%.1f%s", number / 1e9, "G")
elseif abs(number) >= 1e6 then
return format(shortValueFormat, number / 1e6, "M")
return format("%.1f%s", number / 1e6, "M")
elseif abs(number) >= 1e3 then
return format(shortValueFormat, number / 1e3, "k")
else
......@@ -59,17 +59,17 @@ local function ShortValue(number, noDecimal)
end
elseif E.db.general.numberPrefixStyle == "CHINESE" then
if abs(number) >= 1e8 then
return format(shortValueFormat, number / 1e8, "Y")
return format("%.1f%s", number / 1e8, "Y")
elseif abs(number) >= 1e4 then
return format(shortValueFormat, number / 1e4, "W")
return format("%.1f%s", number / 1e4, "W")
else
return format("%d", number)
end
else
if abs(number) >= 1e9 then
return format(shortValueFormat, number / 1e9, "B")
return format("%.1f%s", number / 1e9, "B")
elseif abs(number) >= 1e6 then
return format(shortValueFormat, number / 1e6, "M")
return format("%.1f%s", number / 1e6, "M")
elseif abs(number) >= 1e3 then
return format(shortValueFormat, number / 1e3, "K")
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment