提交 dd365ccd authored 作者: matian's avatar matian

播放量保留一位小数

上级 8fff4cc4
...@@ -3,7 +3,6 @@ import { getRecommendCourse } from '@/api/base' ...@@ -3,7 +3,6 @@ import { getRecommendCourse } from '@/api/base'
import type { IRecommendCourse } from '@/types' import type { IRecommendCourse } from '@/types'
import num from '@/utils/numTo' import num from '@/utils/numTo'
const courseList = ref<{ total: number; list: IRecommendCourse[] }>({ total: 0, list: [] }) const courseList = ref<{ total: number; list: IRecommendCourse[] }>({ total: 0, list: [] })
getRecommendCourse().then(res => { getRecommendCourse().then(res => {
courseList.value = res.data courseList.value = res.data
if (res.data.length > 3) { if (res.data.length > 3) {
......
...@@ -18,7 +18,7 @@ export default function num(value) { ...@@ -18,7 +18,7 @@ export default function num(value) {
if (value % fm === 0) { if (value % fm === 0) {
newValue[0] = parseInt(value / fm) + '' newValue[0] = parseInt(value / fm) + ''
} else { } else {
newValue[0] = parseFloat(value / fm).toFixed(2) + '' newValue[0] = parseFloat(value / fm).toFixed(1) + ''
} }
newValue[1] = text1 newValue[1] = text1
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论