Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/gruffy/base.rb

Overview

Magick

Instance Method Summary collapse

Instance Method Details

#commify(delimiter = ',') ⇒ Object



1211
1212
1213
# File 'lib/gruffy/base.rb', line 1211

def commify(delimiter=',')
  self.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{delimiter}")
end