class ActiveSupport::NumberHelper::NumberToHumanSizeConverter

def exponent

def exponent
  max = STORAGE_UNITS.size - 1
  exp = (Math.log(number) / Math.log(base)).to_i
  exp = max if exp > max # avoid overflow for the highest unit
  exp
end