Module: NumbersAndWords::Translations::Extensions::FractionSignificance
- Included in:
- NumbersAndWords::Translations::En, NumbersAndWords::Translations::Es, Fr, Hu, PtBr, Ru, Ua
- Defined in:
- lib/numbers_and_words/translations/extensions/fraction_significance.rb
Instance Method Summary collapse
- #micro(capacity) ⇒ Object
- #micro_prefix(capacity) ⇒ Object
- #micros(capacity, number = nil, separator = '-') ⇒ Object
Instance Method Details
#micro(capacity) ⇒ Object
11 12 13 |
# File 'lib/numbers_and_words/translations/extensions/fraction_significance.rb', line 11 def micro(capacity) t(:micro)[capacity] end |
#micro_prefix(capacity) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/numbers_and_words/translations/extensions/fraction_significance.rb', line 15 def micro_prefix(capacity) case capacity when 2 then t(:hundreds) when 1 then tens(1) end end |
#micros(capacity, number = nil, separator = '-') ⇒ Object
5 6 7 8 9 |
# File 'lib/numbers_and_words/translations/extensions/fraction_significance.rb', line 5 def micros(capacity, number = nil, separator = '-') micro, prefix = capacity micros = number ? t(micro(micro), count: number) : micro(micro) [micro_prefix(prefix), micros].compact.join separator end |