Skip to content

Commit

Permalink
Merge pull request #22 from iandday/develop
Browse files Browse the repository at this point in the history
feat: fix rounding
  • Loading branch information
iandday authored May 1, 2023
2 parents d1429ce + 3198e9b commit bdc6283
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/which_plates/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def calc_plates(weight: int, available_plates: list[float]) -> dict:
# at least two plates left in remaining weight
if remaining_weight / Decimal(plate) >= Decimal(2):
# can only use even number of plates
if ((remaining_weight / Decimal(plate)) % 2) == 0:
if (int(remaining_weight / Decimal(plate)) % 2) == 0:
plate_count = int(Decimal(remaining_weight) // Decimal(plate))
else:
plate_count = int(Decimal(remaining_weight) // Decimal(plate)) - 1
Expand Down

0 comments on commit bdc6283

Please sign in to comment.