1
0

Dispplaying units of computed values

Fixed formula error messages display when filter formula not given
This commit is contained in:
cryptogopher
2020-03-25 23:07:59 +01:00
parent 2efdc08931
commit e7a33c684f
7 changed files with 16 additions and 14 deletions

View File

@@ -1,13 +1,13 @@
module BodyTrackersHelper
def format_value(value)
amount, unitname = value
amount, unit = value
case
when amount.nil?
'-'
when amount.nan?
'?'
else
"#{amount} [#{unitname || '-'}]"
"#{amount} [#{unit.shortname || '-'}]"
end
end