Skip to content

Commit

Permalink
fix: add case with hours less than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyreplus committed Nov 26, 2024
1 parent 3d2c08f commit b2a5058
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
def prettify_minutes(hours):
hours_truncated = int(hours)
minutes = int((hours-hours_truncated)*60)
if hours_truncated < 1:
return f"{minutes} minuti"
return f"{hours_truncated} ore e {minutes} minuti"

0 comments on commit b2a5058

Please sign in to comment.