Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/gruff/patch/string.rb
Instance Method Summary collapse
Instance Method Details
#commify(delimiter = ',') ⇒ Object
Taken from codesnippets.joyent.com/posts/show/330
5 6 7 |
# File 'lib/gruff/patch/string.rb', line 5 def commify(delimiter = ',') gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{delimiter}") end |