class Integer
Public Instance Methods
to_human_size()
click to toggle source
# File lib/collins_shell/monkeypatch.rb, line 20 def to_human_size return "0 Bytes" if (self == 0) i = (Math.log(self) / Math.log(1024)).floor.to_i small = self / (1024 ** i) if i == 0 then "#{self} #{SIZE_ARRAY[i]}" else sprintf("%.2f %s", small, SIZE_ARRAY[i]) end end