You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
FactorSimulator/utils/time_utils.py

9 lines
314 B

# -*- coding: utf-8 -*-
def format_time(seconds: float) -> str:
"""将秒数格式化为 xx分xx秒 格式"""
if seconds < 60:
return f"{seconds:.2f}"
else:
minutes = int(seconds // 60)
remaining_seconds = seconds % 60
return f"{minutes}{remaining_seconds:.2f}"