Answer the question
In order to leave comments, you need to log in
How to round up to a certain multiplicity?
Something I can't figure out.
For example, there is a product, it is sold at least 10 meters in multiples.
An order for 1 meter arrives - Should be rounded up to 10 meters.
If 12m to 20m
If 29.5 meters to 30 meters
, etc.
Answer the question
In order to leave comments, you need to log in
import math
quantum = 10
quantum * math.ceil(12 / quantum) # 20
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question