Skip to content

Commit 7819965

Browse files
authored
Merge pull request #1 from nikmcphail/main
Fixed rounding error by changing int() to round()
2 parents 3bd0c85 + abb5da8 commit 7819965

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def format_time(self, time_hundredths):
1818
total_seconds = time_hundredths / 100
1919
minutes, seconds = divmod(total_seconds,60)
2020
formatted_seconds = f"{int(seconds)}"
21-
fractional_part =f"{int((total_seconds % 1) * 100):02}"
21+
fractional_part =f"{round((total_seconds % 1) * 100):02}"
2222
formatted_time = f"{formatted_seconds}.{fractional_part}"
2323
if minutes >= 1:
2424
formatted_time = f"{int(minutes)}:{formatted_time}"

0 commit comments

Comments
 (0)