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
to_dec_extension-0.1.0 lib/to_dec_extension.rb
to_dec_extension-1.0.0 lib/to_dec_extension.rb
to_dec_extension-1.0.0.pre.rc.1 lib/to_dec_extension.rb
to_dec_extension-0.0.5 lib/to_dec_extension.rb
to_dec_extension-0.0.4 lib/to_dec_extension.rb
to_dec_extension-0.0.3 lib/to_dec_extension.rb