Sha256: 94190ced1952e03939bd9d71083d3c24f34078c133c656322c95ad470450343c

Contents?: true

Size: 137 Bytes

Versions: 30

Compression:

Stored size: 137 Bytes

Contents

class Numeric
  def commify
    to_s.commify
  end
end

class String
  def commify
    gsub(/(\d)(?=(\d{3})+(\..*)?$)/, '\1,')
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
git-multi-8.0.1 lib/ext/commify.rb
git-multi-8.0.0 lib/ext/commify.rb
git-multi-7.0.0 lib/ext/commify.rb
git-multi-6.0.0 lib/ext/commify.rb
git-multi-5.0.0 lib/ext/commify.rb
git-multi-4.0.1 lib/ext/commify.rb
git-multi-4.0.0 lib/ext/commify.rb
git-multi-3.0.3 lib/ext/commify.rb
git-multi-3.0.2 lib/ext/commify.rb
git-multi-3.0.0 lib/ext/commify.rb
git-multi-2.10.0 lib/ext/commify.rb
git-multi-2.9.0 lib/ext/commify.rb
git-multi-2.8.0 lib/ext/commify.rb
git-multi-2.7.0 lib/ext/commify.rb
git-multi-2.6.1 lib/ext/commify.rb
git-multi-2.6.0 lib/ext/commify.rb
git-multi-2.5.0 lib/ext/commify.rb
git-multi-2.4.0 lib/ext/commify.rb
git-multi-2.3.0 lib/ext/commify.rb
git-multi-2.2.0 lib/ext/commify.rb