Sha256: 0f8b1b8920cf3a9790c4e25f3b793008d793e840972822742d80576a6e9b0c4d

Contents?: true

Size: 445 Bytes

Versions: 15

Compression:

Stored size: 445 Bytes

Contents

require 'enumeration'
require 'osheet/format/numeric'

module Osheet::Format

  class Percentage < Osheet::Format::Numeric
    def initialize(opts={})
      super({
        :decimal_places => 2
      }.merge(opts))
    end

    protected

    # used by 'key' in Numeric base class
    def key_prefix
      "percentage"
    end

    # used by 'decimal_places_style' in Numeric base class
    def decimal_places_suffix
      "%"
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
osheet-1.0.0.rc.4 lib/osheet/format/percentage.rb
osheet-1.0.0.rc.3 lib/osheet/format/percentage.rb
osheet-1.0.0.rc.2 lib/osheet/format/percentage.rb
osheet-1.0.0.rc.1 lib/osheet/format/percentage.rb
osheet-0.10.0 lib/osheet/format/percentage.rb
osheet-0.9.2 lib/osheet/format/percentage.rb
osheet-0.9.1 lib/osheet/format/percentage.rb
osheet-0.9.0 lib/osheet/format/percentage.rb
osheet-0.8.0 lib/osheet/format/percentage.rb
osheet-0.7.0 lib/osheet/format/percentage.rb
osheet-0.6.0 lib/osheet/format/percentage.rb
osheet-0.5.0 lib/osheet/format/percentage.rb
osheet-0.4.0 lib/osheet/format/percentage.rb
osheet-0.3.0 lib/osheet/format/percentage.rb
osheet-0.2.0 lib/osheet/format/percentage.rb