Sha256: 8a807aa9c914d27c05e79eb63da7d650d1f899bbfc1127580421b9289c720c8e

Contents?: true

Size: 290 Bytes

Versions: 26

Compression:

Stored size: 290 Bytes

Contents

# frozen_string_literal: true

NilClass.class_eval do
  # :nodoc:
  def to_dec(*_args)
    nil
  end
end

Numeric.class_eval do
  # :nodoc:
  def to_dec(p = 4)
    (to_f / 100.0).round(p)
  end
end

String.class_eval do
  # :nodoc:
  def to_dec(p = 4)
    (to_f / 100.0).round(p)
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
ruby-rails-extensions-2.1.1 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.14 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.13 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.12 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.11 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.10 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.9 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.8 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.7 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.6 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.5 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.4 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.3 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.2 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.1.0.pre.rc.1 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.0.1 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.0.1.pre.rc.1 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.0.0 lib/ruby-rails-extensions/extensions/to_dec.rb
ruby-rails-extensions-2.0.0.pre.rc.1 lib/ruby-rails-extensions/extensions/to_dec.rb