public static void main(String[] args) {
int one = 5;
int two = 7;
int countAdd = one - two;
String tb = one == 0 ? "0%" : two == 0 ? "100%" : new BigDecimal((float) countAdd * 100 / two).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() + "%";
System.out.println(tb);
}
计算增长率,同比写法
最新推荐文章于 2023-02-27 16:38:40 发布