diff --git a/fusion-woo-odoo/fusion_woocommerce/static/src/js/product_mapping.js b/fusion-woo-odoo/fusion_woocommerce/static/src/js/product_mapping.js index 41541d7d..eb6b0aa9 100644 --- a/fusion-woo-odoo/fusion_woocommerce/static/src/js/product_mapping.js +++ b/fusion-woo-odoo/fusion_woocommerce/static/src/js/product_mapping.js @@ -545,7 +545,13 @@ export class ProductMapping extends Component { startEdit(mapId, field, currentValue) { this.state.editingCell = { mapId, field }; - this.state.editValue = currentValue !== null && currentValue !== undefined ? String(currentValue) : ''; + let val = currentValue !== null && currentValue !== undefined ? currentValue : ''; + if (val !== '' && field === 'margin') { + val = String(Math.round(parseFloat(val))); + } else if (val !== '') { + val = String(parseFloat(parseFloat(val).toFixed(2))); + } + this.state.editValue = val; // Focus the input after OWL re-renders setTimeout(() => { const input = document.querySelector('.woo-edit-input');