Skip to content

Commit

Permalink
Check if last char is in the times dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
Divkix committed Feb 27, 2023
1 parent ffc88f0 commit 16cfb2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pypers/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ def get_time_in_seconds(time: str) -> int:
"m": 2630000,
"y": 31536000,
}
# Check if last char is in the times dictionary
if not time[-1].lower() in times:
return 0
return int(time[:-1]) * times[time[-1]]

0 comments on commit 16cfb2d

Please sign in to comment.