summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2021-05-17 14:57:45 +0000
committerNicolas Lempereur <nle@odoo.com>2021-05-17 17:36:05 +0000
commit23dd2ea535bea0a57dcac773a81e202135cd2ed6 (patch)
treec973e8a95c080ffacde74c69570de266831c0432 /doc
parentdef7d7bb0231fef38e044803b245c9b990a90216 (diff)
[FIX] point_of_sale: rounding down near 0
Before 03025520b rounding applied was eg. for these numbers and UP and DOWN rounding methods to multiple of 10: ``` Numbers | -8 | -2 | 2 | 8 | 12 DOWN | -2 | -8 | -2 | -8 | -2 UP | 8 | 2 | 8 | 2 | 8 ``` which is correct for positive numbers but UP and DOWN are inversed for negatives numbers. After 03025520b this became: ``` Numbers | -8 | -2 | 2 | 8 | 12 DOWN | 8 | 2 | 8 | -8 | -2 UP | -2 | -8 | -2 | 2 | 8 ``` which is correct for all cases except for positive numbers that are before HALF of the precision (eg. number 2) for which UP and DOWN are inversed. This is happening because 03025520b uses the sign of the rounded value => this does not work for 0 so number 2 is broken (and if fixed number -2 would be broken). With this commit, the adjustement of sign is done based on original number, so we get the equivalent of python equivalent methods: ``` Numbers | -8 | -2 | 2 | 8 | 12 DOWN | 8 | 2 | -2 | -8 | -2 UP | -2 | -8 | 8 | 2 | 8 ``` opw-2451841 closes odoo/odoo#70910 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions