code: private static String bitsToString(long megabits) {
          int unit = 1000;
          if (megabits < unit) {
              return megabits + " mb";
          }
          int exp = (int) (Math.log(megabits) / Math.log(unit));
          return new DecimalFormat("#.##").format(megabits / Math.pow(unit, exp)) + "GTPE".charAt(exp - 1) + "b";
      }
docs: Convert megabits into a more 'human readable' format (from 'long' to 'String')
  
  @param megabits  the amount in megabit (mb)
  @return a String containing a pretty formatted output