var val=(1+parseFloat(op_custom_tax_rate))*parseFloat(order_total) val=(''+val).replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 '); d1.innerHTML = Onepage.formatCurrency(val);