Module Cms::Extensions::Integer
In: lib/cms/extensions/integer.rb

Methods

Public Instance methods

[Source]

    # File lib/cms/extensions/integer.rb, line 4
 4:       def round_bytes
 5:         if self > 1.megabyte
 6:           "%0.2f MB" % (self.to_f/1.megabyte)
 7:         elsif self > 1.kilobyte
 8:           "%0.2f KB" % (self.to_f/1.kilobyte)
 9:         else
10:           "#{self} bytes"
11:         end
12:       end

[Validate]