fix output time string conversion
This commit is contained in:
+3
-3
@@ -636,15 +636,15 @@ def format_seconds(seconds: int | float | None) -> str:
|
||||
return f"{hours:02d}:{minutes:02d}:{sec:02d}"
|
||||
|
||||
def format_hours(hours: float | None) -> str:
|
||||
"""Return string representation in format hours:seconds"""
|
||||
"""Return string representation in format hours:minutes:seconds."""
|
||||
if hours is None:
|
||||
return "Unknown"
|
||||
td = timedelta(hours)
|
||||
td = timedelta(hours=hours)
|
||||
sraw = int(td.total_seconds())
|
||||
hr = sraw // 3600
|
||||
mn = (sraw % 3600) // 60
|
||||
sc = sraw % 60
|
||||
return f"{hr}:{round(mn,0)}:{sc}"
|
||||
return f"{hr}:{round(mn,0):02d}:{sc:02d}"
|
||||
|
||||
|
||||
def parse_size_to_bytes(value: str) -> int | None:
|
||||
|
||||
Reference in New Issue
Block a user