天天看點

Long類型的百分數,保留兩位

Long a = 11111111111111L;
        Long b = 22222222222222L;
        String format = String.format("%.2f", ((a.doubleValue() / b.doubleValue()) * 100))+"%";
        System.out.println(format);