As @JaredPar pointed out in his answer , use parseFloat with replacement
var fullcost = parseFloat($("#fullcost").text().replace(',', '.'));
Only replacing comma with dot will be fixed. If not , a number over thousands, for example 1.000.000,00 , will lead to an incorrect digit. Therefore you need to replace comma remove dots .
// Remove all dot's. Replace the comma. var fullcost = parseFloat($("#fullcost").text().replace(/\./g,'').replace(',', '.'));
Using two substitutions, you can process the data without getting the wrong numbers in the output.
Michel Ayres Mar 17 '14 at 12:07 2014-03-17 12:07
source share