fix: round final compact progress fraction to completion

This commit is contained in:
2026-10-17 23:08:52 +02:00
parent 2b96a165d2
commit d4704af442
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -7,6 +7,7 @@ func compactProgressText(position: Double, duration: Double, format: CompactTitl
let position = min(max(0, position), duration)
if format == .percentage {
let tenths = Int((position / duration * 1000).rounded(.down))
if tenths == 999 { return "100.0" }
return "\(tenths / 10).\(tenths % 10)"
}
let total = Int(min(duration, Double(Int.max / 2)))