小數點精度 === ```java= NumberFormat nf = NumberFormat.getInstance(); // 數字格式 nf.setMaximumFractionDigits(2); // 限制小數第二位 float result = (float)150 / (float)7; // 計算BMI System.out.println(nf.format(result)); // 顯示BMI計算結果 ``` ###### tags: `實作相關`