第一次提交
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
export const getTimeText = (time: number = 0, hasUnit = true) => {
|
||||
if (time < 3600) {
|
||||
return String(Math.floor(time / 60)) + (hasUnit ? ' 分钟' : '')
|
||||
} else {
|
||||
return String(Math.round(time / 3600 * 10) / 10) + (hasUnit ? ' 小时' : '')
|
||||
}
|
||||
}
|
||||
|
||||
export const getPercentText =
|
||||
(value: number, total: number) => Math.round(value / total * 100) + '%'
|
||||
Reference in New Issue
Block a user