فهرست منبع

添加中奖概率

kk 2 ماه پیش
والد
کامیت
f86963b9d4
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      game-business/src/main/java/com/game/business/controller/AppGameItemController.java

+ 1 - 1
game-business/src/main/java/com/game/business/controller/AppGameItemController.java

@@ -84,7 +84,7 @@ public class AppGameItemController extends BaseController
                 }else{
                     BigDecimal lotteryCount = new BigDecimal(gameItem.getLotteryCount());
                     BigDecimal lotteryRate = lotteryCount.divide(lotteryCountSum,4, BigDecimal.ROUND_HALF_UP);
-                    appGameItemVO.setLotteryRate(lotteryRate.multiply(new BigDecimal(100)).toString());
+                    appGameItemVO.setLotteryRate(lotteryRate.multiply(new BigDecimal(100)).setScale(2,  BigDecimal.ROUND_HALF_UP).toString());
                 }
 
                 resultList.add(appGameItemVO);