Class: Gloo::Utils::Format
- Inherits:
-
Object
- Object
- Gloo::Utils::Format
- Defined in:
- lib/gloo/utils/format.rb
Class Method Summary collapse
-
.number(num) ⇒ Object
Format number, adding comma separators.
Class Method Details
.number(num) ⇒ Object
Format number, adding comma separators. Ex: 1000 -> 1,000
15 16 17 |
# File 'lib/gloo/utils/format.rb', line 15 def self.number( num ) return num.to_s.reverse.scan( /.{1,3}/ ).join( ',' ).reverse end |