File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed
Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ Contributors:
141141 * Josh Lynch (josh-lynch)
142142 * Fabio (3ximus)
143143 * Doug Harris (dougharris)
144+ * Jay Knight (jay-knight)
144145
145146Creator:
146147--------
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ Internal:
1717 * Update dev requirements and replace requirements-dev.txt with pyproject.toml
1818 * Use ruff instead of black
1919
20+ Bug fixes:
21+ ----------
22+
23+ * Improve display of larger durations when passed as floats
24+
20254.3.0 (2025-03-22)
2126==================
2227
Original file line number Diff line number Diff line change @@ -1926,12 +1926,12 @@ def duration_in_words(duration_in_seconds: float) -> str:
19261926 components = []
19271927 hours , remainder = divmod (duration_in_seconds , 3600 )
19281928 if hours > 1 :
1929- components .append (f"{ hours } hours" )
1929+ components .append (f"{ int ( hours ) } hours" )
19301930 elif hours == 1 :
19311931 components .append ("1 hour" )
19321932 minutes , seconds = divmod (remainder , 60 )
19331933 if minutes > 1 :
1934- components .append (f"{ minutes } minutes" )
1934+ components .append (f"{ int ( minutes ) } minutes" )
19351935 elif minutes == 1 :
19361936 components .append ("1 minute" )
19371937 if seconds >= 2 :
Original file line number Diff line number Diff line change @@ -565,9 +565,11 @@ def test_application_name_db_uri(tmpdir):
565565 (60 , "1 minute" ),
566566 (61 , "1 minute 1 second" ),
567567 (123 , "2 minutes 3 seconds" ),
568+ (124.4 , "2 minutes 4 seconds" ),
568569 (3600 , "1 hour" ),
569570 (7235 , "2 hours 35 seconds" ),
570571 (9005 , "2 hours 30 minutes 5 seconds" ),
572+ (9006.7 , "2 hours 30 minutes 6 seconds" ),
571573 (86401 , "24 hours 1 second" ),
572574 ],
573575)
You can’t perform that action at this time.
0 commit comments