Sha256: bf3d57e4c2e1bbfb882069caddedcd96728f05f300866d56b8fa2ccf4e95a7bb

Contents?: true

Size: 193 Bytes

Versions: 2

Compression:

Stored size: 193 Bytes

Contents

class Float
  def decimal(precision = 2)
    ((self % 1) * (10 ** precision)).round
  end

  def diff(number)
    return 0 if number.zero?
    (((self - number) / number)* 100).round
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
forgeos_commerce-1.9.1.rc1 lib/forgeos/commerce/float.rb
forgeos_commerce-1.9.0 lib/forgeos/commerce/float.rb