fix(emballe): le reste peut être nul
This commit is contained in:
parent
c933219290
commit
52497a3b20
@ -17,6 +17,10 @@ def submit_row_tag(parser, token):
|
||||
def emballe(quantité, fourniture):
|
||||
quotient = quantité // fourniture.conditionnement
|
||||
reste = quantité % fourniture.conditionnement
|
||||
if not reste and quotient == 1:
|
||||
return f"{quotient} {fourniture.emballage}"
|
||||
if not reste and quotient > 1:
|
||||
return f"{quotient} {fourniture.emballage}s"
|
||||
if not quotient and reste < fourniture.conditionnement/2:
|
||||
return None
|
||||
if quotient == 1 and reste < fourniture.conditionnement/2:
|
||||
|
Loading…
x
Reference in New Issue
Block a user