mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 04:46:44 +08:00
增加通用方法:formatSecondToHour(将秒转换成小时)
This commit is contained in:
@@ -374,3 +374,19 @@ export function formatUserNumber(num) {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将秒转换成小时
|
||||||
|
* @author wn
|
||||||
|
* @date 2022.10.18
|
||||||
|
* @param {Object} second 秒
|
||||||
|
* @@return 小时
|
||||||
|
*/
|
||||||
|
export function formatSecondToHour(second) {
|
||||||
|
var n = 1; // 保留小数位
|
||||||
|
second = Number(second);
|
||||||
|
var h = second / 3600;
|
||||||
|
h = h.toFixed(n);
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user