나는 여기에 자바 스크립트와 HTML 코드 my code
이 있고 난 때 계산 특정 필드 이상한 값을 가져옵니다. 하나의 체크 박스에는 현재 스크립트 (배경 음악 addon)가 있고 오직 3in 릴 중 하나를 추가 할 때만 총 가격이 24.990000000000002가됩니다. 그것은 단지 그 입력과 함께 그 이상한 것입니다 ... 그것은 단지 24.99 여야합니다 .... 모든 다른 입력 작업과 정확한 합계를 제공하지만, 단지 3 개의 3in 필드는 그 숫자를줍니다 ... 시행 착오를 통해 나는 문제는 3 자리수의 값에 의해 여기
regthreetot = parseFloat(regthree * 50);
regfourtot = parseFloat(regfour * 100);
regfivetot = parseFloat(regfive * 200);
regsixtot = parseFloat(regsix * 300);
regseventot = parseFloat(regseven * 400);
supthreetot = parseFloat(supthree * 50);
supfourtot = parseFloat(supfour * 100);
supfivetot = parseFloat(supfive * 200);
supsixtot = parseFloat(supsix * 300);
supseventot = parseFloat(supseven * 400);
sixthreetot = parseFloat(sixthree * 50);
sixfourtot = parseFloat(sixfour * 100);
sixfivetot = parseFloat(sixfive * 200);
sixsixtot = parseFloat(sixsix * 300);
sixseventot = parseFloat(sixseven * 400);
regthree, supthree 및 sixthree 값 50 승산
... 모든 다른 값이 승산있다 ... 난 50~100 변경할 경우에는 줄 것이다 정상적인 대답 ... 왜 숫자가 중요합니까? 그리고 그것을 해결하기 위해 무엇을 할 수 있습니까?
** 반드시이 **에 방법이 될 그 코드 조각을 단순화 ... – elclanrs
def def is ... 나는 단지 어떻게 ... ... – user1556319
[돈을 위해 수레를 사용하지 마십시오] (http://stackoverflow.com/questions/3730019/why-not) -use-double-or-float-to-currency) – Mat