fix: 课程时长四舍五入

This commit is contained in:
liuzixi
2025-12-20 10:11:45 +08:00
committed by liu.zixi
parent 1bb5b95ad9
commit 9aae836b31

View File

@@ -297,7 +297,8 @@ public class CoursePageServiceImpl implements ICoursePageService {
// map.put("sysType", coursePageVo.getSysType1());
map.put("teacherName", coursePageVo.getTeacherName());
// 课程时长:秒转分
map.put("courseDuration", coursePageVo.getCourseDuration() / 60);
long minutes = Math.round((double) coursePageVo.getCourseDuration() / 60);
map.put("courseDuration", minutes);
map.put("studys", coursePageVo.getStudys());
// 课程评分显示1位小数四舍五入
map.put("score", coursePageVo.getScore() == null ? "0.0" : String.format("%.1f", Math.round(coursePageVo.getScore() * 10.0) / 10.0));