以下程序显示了如何将数字四舍五入到小数点后两位。
public class Tester { public static void main(String[] args) { double number = 122.2363534; double result = Math.round(number*100)/100.0d; System.out.println(result); } }
输出结果
122.24
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分