Module: NumbersAndWords::Translations::Extensions::FractionSignificance

Included in:
Cs, NumbersAndWords::Translations::En, NumbersAndWords::Translations::EnGb, NumbersAndWords::Translations::Es, Fr, Hu, PtBr, Ru, Ua, Vi
Defined in:
lib/numbers_and_words/translations/extensions/fraction_significance.rb

Instance Method Summary collapse

Instance Method Details

#micro(capacity) ⇒ Object


13
14
15
# File 'lib/numbers_and_words/translations/extensions/fraction_significance.rb', line 13

def micro(capacity)
  t(:micro)[capacity]
end

#micro_prefix(capacity) ⇒ Object


17
18
19
20
21
22
# File 'lib/numbers_and_words/translations/extensions/fraction_significance.rb', line 17

def micro_prefix(capacity)
  case capacity
  when 2 then t('micro_prefix.hundreds')
  when 1 then t('micro_prefix.tens')
  end
end

#micros(capacity, number = nil) ⇒ Object


7
8
9
10
11
# File 'lib/numbers_and_words/translations/extensions/fraction_significance.rb', line 7

def micros(capacity, number = nil)
  micro, prefix = capacity
  micros = number ? t(micro(micro), count: number) : micro(micro)
  [micro_prefix(prefix), micros].compact.join(t('micro_prefix.union'))
end