java中提供了DecimalFormat类 java.text.DecimalFormat df=new java.text.DecimalFormat(); df.applyPattern("00"); df.format(要格式化的数字)