Sha256: 504f49e9fe5854ba5336d8d719316b321efdc29de2df7f0e26dff8bfa962152c

Contents?: true

Size: 139 Bytes

Versions: 6

Compression:

Stored size: 139 Bytes

Contents

class Fixnum
  def digits(base = 10)
    num = self.abs
    if num == 0
      1
    else
      Math.log10(num).floor + 1
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
green-button-data-0.3.0 lib/green-button-data/core_ext/fixnum.rb
green-button-data-0.2.1 lib/green-button-data/core_ext/fixnum.rb
green-button-data-0.2.0 lib/green-button-data/core_ext/fixnum.rb
green-button-data-0.1.2 lib/green-button-data/core_ext/fixnum.rb
green-button-data-0.1.1 lib/green-button-data/core_ext/fixnum.rb
green-button-data-0.1.0 lib/green-button-data/core_ext/fixnum.rb