1024
%w[B KB MB GB TB PB EB ZB]
11 12 13 14 15 16
# File 'lib/test_prof/memory_prof/printer/number_to_human.rb', line 11 def convert(number) exponent = exponent(number) human_size = number.to_f / (BASE**exponent) "#{round(human_size)}#{UNITS[exponent]}" end