java整数相除怎么保留小数位
Integer discount = 0; if(isVip){ discount = configMapper.getValueByName("vip_discount"); }else{ discount = configMapper.getValueByName("free_discount"); } System.out.println("discount"+discount); double userDiscount = discount/100; |
discount是98的时候,结果userDiscount = 0.0
解决参考地址 https://www.cnblogs.com/Marydon20170307/p/10911049.html