code: public static String formatNumber(int num) {
          DecimalFormat format = new DecimalFormat();
          format.setDecimalSeparatorAlwaysShown(false);
          return format.format(num);
      }
docs: Format the passed number, added commas for the decimal parts.
  <p/>
  Created on Dec 3, 2008 by depryf
  @param num number to format
  @return formatted number