I'm so sorry, but I need help :(
I've tried to convert string to decimal and it works, but I have some problem:
number = document.getElementById("totalcost").innerHTML; //It is a string, but I am sure that it is a decimal
number2 = prodCost; //it is a string but in fact it is a decimal too
alert(parseFloat(number)); // prints good (if number is 88,9 it will print 88,9)
alert(parseFloat(number2)); // it's ok too
alert(parseFloat(number) - parseFloat(number2)); // this is not ok :(
//if number=88,9 and number2=17,77 I get 71 but i need 71,13
Oh, guys, I'm so sorry, I'm stupit. Thank you so much! I have been working for the 9th hour in a row.. I'm really sorry, thank you all!