一個數字位數不夠時前面補0

//import java.text.DecimalFormat Integer num1 = 1; Integer num2 = 1002; DecimalFormat df=new DecimalFormat("000"); String str1 = df.format(num1); //001 String str2 = df.format(num2); //1002 上述代碼中,數
相關文章
相關標籤/搜索