增加通用方法:formatSecondToHour(将秒转换成小时)

This commit is contained in:
weinan2087
2022-10-18 17:47:00 +08:00
parent 3c0e745766
commit 8a4acbba2e

View File

@@ -374,3 +374,19 @@ export function formatUserNumber(num) {
}
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;
}