protected static DecimalFormat decimalFormat = null;public static String formatNumeric(double value, String pattern) {
    synchronized (decimalFormat) {
      decimalFormat.applyPattern(pattern);
      return decimalFormat.format(value);
    }仿照以上方法.