在Java中,是否可以使用String.format僅在實際需要時才顯示小數?例如,如果我這樣做: String.format("%.1f", amount); 它將格式化: “1.2222”->“1.2”
確定! 回上一頁