CN-1563 feat: 功能整合

This commit is contained in:
chenjinsong
2024-03-03 22:10:02 +08:00
parent 8d1b430309
commit abbefe1770
4 changed files with 533 additions and 201 deletions

View File

@@ -56,7 +56,7 @@ export function timeUnitFormatter (time, sourceUnit = 'ms', targetUnit, dot = 2)
let multi = 1
let result = parseFloat(time)
if (targetIndex < 0) {
while (sourceIndex < timeUnit.length - 1 && result > timeUnit[sourceIndex + 1].step) {
while (sourceIndex < timeUnit.length - 1 && result >= timeUnit[sourceIndex + 1].step) {
sourceIndex++
multi = timeUnit[sourceIndex].step
result /= multi