string.format 阿岩 2022-02-24 187 阅读1分钟 double num = 3.1415926; String format = String.format("%.2f", num); System.err.println(format);