Class: Numeric

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

Overview

Commify numbers.

Instance Method Summary collapse

Instance Method Details

#commifyObject



32
33
34
# File 'lib/BioDSL.rb', line 32

def commify
  to_s.gsub(/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/, '\1,')
end