Class: Numeric
Overview
The Numeric class
Instance Method Summary collapse
Instance Method Details
#commas(delimiter = ',') ⇒ Object
247 248 249 250 251 |
# File 'lib/runtime/mixins.rb', line 247 def commas(delimiter = ',') parts = self.to_s.split('.') parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, format(JoinedTemplate, str: '\1', other: delimiter)) parts.join('.') end |