活动数据小数点后位保留
This commit is contained in:
@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.*;
|
||||
@@ -76,7 +77,8 @@ public class ActivityDayTotalAdminService {
|
||||
vo.setActName(activityDayTotal.getActKey());
|
||||
}
|
||||
if (activityDayTotal.getActNum() > 0) {
|
||||
vo.setPerValue((activityDayTotal.getActNum() * 1.0) / (activityDayTotal.getActUserNum() * 1.0));
|
||||
vo.setPerValue(BigDecimal.valueOf((activityDayTotal.getActNum() * 1.0) / (activityDayTotal.getActUserNum() * 1.0))
|
||||
.setScale(2, RoundingMode.DOWN).doubleValue());
|
||||
} else {
|
||||
vo.setPerValue(0D);
|
||||
}
|
||||
|
Reference in New Issue
Block a user