Sha256: 0fa1066fe93c05d17c99b4297518a19d8f5140aa3f2a4e756f94eb59bf4b4351

Contents?: true

Size: 457 Bytes

Versions: 6

Compression:

Stored size: 457 Bytes

Contents

module Maths
  # Public: Represents a number that should be formatted as a percentage
	class Percentage < BigDecimal
    # Pretty much idential to a BigDecimal
    
    # Public: Builds out a fraction by the numerator and denominator
    def self.build(numerator, denominator)
      numerator = BigDecimal.new(numerator.to_s)
      denominator = BigDecimal.new(denominator.to_s)
      Percentage.new(((numerator / denominator) * 100).to_s)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
maths-0.0.10 lib/maths/percentage.rb
maths-0.0.9 lib/maths/percentage.rb
maths-0.0.8 lib/maths/percentage.rb
maths-0.0.7 lib/maths/percentage.rb
maths-0.0.6 lib/maths/percentage.rb
maths-0.0.5 lib/maths/percentage.rb