reformatting

This commit is contained in:
Baipyrus 2023-11-05 17:05:43 +01:00
parent 40eb131fce
commit 1d8485fe84

View File

@ -55,7 +55,7 @@ function format_percent(options, number, mult)
percent = number * 100
end
return string.format('%.2f ', percent) .. '% ' .. string.rep(' ', #(options.unit or ''))
return string.format('%.2f ', percent) .. '% ' .. string.rep(' ', #(options.unit or ' '))
end
-- format temperature as number with two decimals and padded unit
@ -67,7 +67,7 @@ function format_temp(options, number)
else temperature = string.format('%.2f ', temperature) end
-- build string
return temperature .. 'K ' .. string.rep(' ', #(options.unit or ''))
return temperature .. 'K ' .. string.rep(' ', #(options.unit or ' '))
end
-- format liquids as compact number and padded unit