Module: Eboshi::ApplicationHelper

Defined in:
app/helpers/eboshi/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#currency_or_empty(value) ⇒ Object



9
10
11
12
# File 'app/helpers/eboshi/application_helper.rb', line 9

def currency_or_empty(value)
  return '--' unless value.nonzero?
  number_to_currency value
end

#number_to_per_hour(value) ⇒ Object



3
4
5
6
7
# File 'app/helpers/eboshi/application_helper.rb', line 3

def number_to_per_hour(value)
  return nil unless value
  precision = (value.round == value ? 0 : 2)
  number_to_currency(value, precision: precision) + "/hr"
end