diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 8c5254946d5..d1a1ed7fe6f 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -3262,7 +3262,10 @@ exports.Order = Backbone.Model.extend({ var rounding_applied = total - (this.pos.config['iface_tax_included'] === "total"? this.get_subtotal(): this.get_total_with_tax()); // because floor and ceil doesn't include decimals in calculation, we reuse the value of the half-up and adapt it. - if(this.pos.cash_rounding[0].rounding_method === "UP" && rounding_applied < 0) { + if (utils.float_is_zero(rounding_applied)){ + // https://xkcd.com/217/ + return 0; + } else if(this.pos.cash_rounding[0].rounding_method === "UP" && rounding_applied < 0) { rounding_applied += this.pos.cash_rounding[0].rounding; } else if(this.pos.cash_rounding[0].rounding_method === "DOWN" && rounding_applied > 0){