Sha256: 5e7db05268176fb86363aacb2017d215aca0e70344ef99f469529de011f1cc5d

Contents?: true

Size: 220 Bytes

Versions: 2

Compression:

Stored size: 220 Bytes

Contents

# encoding: utf-8

module RujitsuNumeric
  # convert float values to "cents"
  #   my_value = 2.5
  #   my_value.to_cents # => 250
  def to_cents
    (self * 100.0).to_i
  end
end

Numeric.send(:include, RujitsuNumeric)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rujitsu-0.5.0 lib/rujitsu/numeric.rb
rujitsu-0.4.0 lib/rujitsu/numeric.rb