Skip to content

Commit

Permalink
fix : minor edit in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Sep 4, 2024
1 parent 9c8c194 commit 5330164
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mycoffee/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def coffee_calc(params, digit=3):
:return: coffee amount as float
"""
coffee = params["water"] * params["coffee_ratio"] / params["water_ratio"]
if is_int(coffee):
return coffee
if is_int(coffee) or digit == 0:
return int(coffee)
return round(coffee, digit)


Expand Down

0 comments on commit 5330164

Please sign in to comment.