Sha256: e2d0d18a5e60153c2decfae6c55aa7a7587e38c11c23d45ea4734548e743e540

Contents?: true

Size: 356 Bytes

Versions: 49

Compression:

Stored size: 356 Bytes

Contents

# frozen_string_literal: true

module ActiveSupport
  module NumberHelper
    class NumberToPercentageConverter < NumberConverter # :nodoc:
      self.namespace = :percentage

      def convert
        rounded_number = NumberToRoundedConverter.convert(number, options)
        options[:format].gsub("%n".freeze, rounded_number)
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 8 rubygems

Version Path
activesupport-5.2.8.1 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.8 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.7.1 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.7 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.6.3 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.6.2 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.6.1 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.6 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.4.6 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.5 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.4.5 lib/active_support/number_helper/number_to_percentage_converter.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.1/lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.4.4 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.4.3 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.4.2 lib/active_support/number_helper/number_to_percentage_converter.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.4.1/lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.4.1 lib/active_support/number_helper/number_to_percentage_converter.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.4 lib/active_support/number_helper/number_to_percentage_converter.rb
activesupport-5.2.4.rc1 lib/active_support/number_helper/number_to_percentage_converter.rb