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

发表评论

邮箱地址不会被公开。 必填项已用*标注