class NumbersAndWords::Strategies::FiguresConverter::Decorators::En::Fractional
Public Instance Methods
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb, line 9 def run "#{super} #{fraction_significance}" end
Private Instance Methods
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb, line 23 def figures @strategy.figures.reverse end
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb, line 31 def fraction_length @options[:fractional][:length].to_i end
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb, line 15 def fraction_significance @strategy.translations.micros full_fraction.fraction_capacity, figures.join.to_i end
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb, line 19 def full_fraction (0..zero_length).inject(figures.clone) { |result, _el| result.unshift 0 }.to_figures end
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb, line 27 def zero_length fraction_length - figures.length end