Class: Integer

Inherits:
Object show all
Defined in:
lib/qooxview/additions.rb

Instance Method Summary collapse

Instance Method Details

#separator(sep = ' ') ⇒ Object



141
142
143
144
145
# File 'lib/qooxview/additions.rb', line 141

def separator(sep = ' ')
  self.to_s.tap do |s|
    :go while s.gsub!(/^([^.]*)(\d)(?=(\d{3})+)/, "\\1\\2#{sep}")
  end
end

#to_MB(label = 'MB') ⇒ Object



147
148
149
# File 'lib/qooxview/additions.rb', line 147

def to_MB(label = 'MB')
  "#{(self / 1_000_000).separator} #{label}"
end