lib/store/digest.rb
# Return a human-readable byte size.
# @return [String] a representation of the byte size of the store.
Return a human-readable byte size.
Return a human - readable byte size .
def human_size
      mag  = @bytes == 0 ? 0 : (Math.log(@bytes, 2) / 10).floor
      if mag > 0
        '%0.2f %s (%d bytes)' % [(@bytes.to_f / 2**(mag * 10)).round(2),
          MAGNITUDES[mag], @bytes]
      else
        "#{@bytes} bytes"
      end
    end
def human_size mag = @bytes == 0 ? 0 : ( Math . log ( @bytes , 2 ) / 10 ) . floor if mag > 0 '%0.2f %s (%d bytes)' % [ ( @bytes . to_f / 2 ** ( mag * 10 ) ) . round ( 2 ) , MAGNITUDES [ mag ] , @bytes ] else "#{@bytes} bytes" end end
Return a human-readable byte size.
Return a human - readable byte size .
# the deci-magnitude also happens to conveniently work as an array index
a representation of the byte size of the store.
a representation of the byte size of the store .
String