mirror of
https://fuchsia.googlesource.com/third_party/pigweed.googlesource.com/pigweed/pigweed
synced 2024-09-21 06:12:09 +00:00
pw_presubmit: Better formatting for long times
Change-Id: I3f5ed338718ede5a93900217bd7b4fbe31159c26 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/33120 Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Keir Mierle <keir@google.com>
This commit is contained in:
parent
969f44ef3f
commit
a303b4f879
|
@ -83,7 +83,10 @@ def _title(msg, style=_SUMMARY_BOX) -> str:
|
|||
|
||||
def _format_time(time_s: float) -> str:
|
||||
minutes, seconds = divmod(time_s, 60)
|
||||
return f' {int(minutes)}:{seconds:04.1f}'
|
||||
if minutes < 60:
|
||||
return f' {int(minutes)}:{seconds:04.1f}'
|
||||
hours, minutes = divmod(minutes, 60)
|
||||
return f'{int(hours):d}:{int(minutes):02}:{int(seconds):02}'
|
||||
|
||||
|
||||
def _box(style, left, middle, right, box=tools.make_box('><>')) -> str:
|
||||
|
|
Loading…
Reference in New Issue
Block a user