0
$("#totalinvoicevalue").text($.trim($('#total_product_gst').html()) + totalcharge.toFixed(2));

$.trim($('#total_product_gst').html()) = 1050.00  
totalchage = 100 

I get result 1050.00100
I expect 1150.00
please help how to deal with it in jquery

Bhushan Kawadkar
  • 28,279
  • 5
  • 35
  • 57
rupali
  • 3
  • 4

1 Answers1

0

You could parse your string to a float :

let totalProductGst = parseFloat($.trim($('#total_product_gst').html()));
let totalCharge = parseFloat(totalcharge.toFixed(2));
$("#totalinvoicevalue").text( totalProductGst + totalCharge );
Dylan KAS
  • 4,840
  • 2
  • 15
  • 33