Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/gruff/patch/string.rb

Instance Method Summary collapse

Instance Method Details

#commify(delimiter = ',') ⇒ Object



5
6
7
# File 'lib/gruff/patch/string.rb', line 5

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