I have this JS file. This snippet will display Delivery Charge but its in 4 decimal places. I want it to display only two decimal places. How to change the code?
if (val.order_id > 0) {
html += '<div class="col text-right">';
html += "<b class='amout'>" + val.order_total_amount + "</b>";
html += "<b class='charge_thaitop " + val.payment_type_raw + "'>" + getTrans('Delivery Fee ', 'deliver_fee') + getTrans('RM', 'MYR') + val.delivery_charge + "</b>";
html += '</div>';
}
The + val.delivery_charge+ will output the number but currently its in 4 decimal places. I want it in two decimal places only. Refer the output in the picture below:
Thanks