diff --git a/fiscal_epos_print/static/src/js/models.js b/fiscal_epos_print/static/src/js/models.js index fe22148d2f70..35bd9aa27e00 100644 --- a/fiscal_epos_print/static/src/js/models.js +++ b/fiscal_epos_print/static/src/js/models.js @@ -200,7 +200,7 @@ odoo.define("fiscal_epos_print.models", function (require) { if (receipt.tax_department.included_in_price === true) { receipt.full_price = this.price; } else { - // This strategy was used because JavaScript's Math.round rounds to the nearest integer + // This strategy was used because rounds to the nearest integer const dec_precision = this.pos.currency.decimal_places; const full_price = Number( ( @@ -208,9 +208,9 @@ odoo.define("fiscal_epos_print.models", function (require) { (1 + receipt.tax_department.tax_amount / 100) ).toFixed(dec_precision) ); - const rounding_factor = Math.pow(10, dec_precision); - receipt.full_price = - Math.trunc(full_price * rounding_factor) / rounding_factor; + receipt.full_price = parseFloat( + full_price.toFixed(dec_precision) + ); } }