parseFloat

Subject:

this is use to convert string into decimal values to calculate 

var discounts = 0;

var discount = $('.product-container').find('div[product-id="'+id+'"]').attr('product-discount');

var sum = $( this ).find('div:first-child').text();

var presentPrice = $( this ).find('div:nth-child(3)').text();

discounts += parseFloat(discount);

2017-09-22 08:29:54gstlouis