code: private void writeNumber(PrintWriter pw, NumberFormat numFormat, Number num){
  		if( num.doubleValue() == Math.round(num.doubleValue()) ){
  			// Integer
  			if( null != numFormat ){
  				pw.print( numFormat.format(num.intValue()) );
  			} else {
  				pw.print( num.intValue() );
  			}
  			
  		} else {
  			if( null != numFormat ){
  				pw.print( numFormat.format(num) );
  			} else {
  				pw.print( num );
  			}
  		}
  	}
docs: Writes a number to the print writer. If the number is an integer, do not
  write the decimal points.
  @param pw
  @param num