Java 提供DecimalFormat 類,幫你用最快的速度將數字格式化為你需要的樣子。 ... 位整數 System.out.println(new DecimalFormat("0").format(pi));//3 ...
確定! 回上一頁