Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] delivery_schenker: round up package volume
The Schenker API requires a volume to be non-zero, but also forces 2 decimal places. The 0.01 minimum was removed for avoiding fake volumes when incorrectly configured, but we must still round up cases where the volume is non-zero but rounds to 0.00. It is also logical to give an overestimate on the volume to the carrier, rather than an underestimate. round -> repr -> float to avoid Python floating decimals that error when validating with the Schema. float_round(2.086, precision_digits=2) = 2.0100000000000002 float_repr(float_round(2.086, precision_digits=2), 2) = '2.01' (string) float(float_repr(float_round(2.086, precision_digits=2), 2)) = 2.01
- Loading branch information