Results 1 to 14 of 14
May 3, 2012, 16:39 #1
- Join Date
- Aug 2011
- Madrid, Spain
- 0 Post(s)
- 0 Thread(s)
parseFloat - parseInt?? This will be 2 mins for anyone with a little js knowledge...
I'm busy with my Js final project at the end of my Js "kinda" beginners course. The website set up for the final project requires a section including a form used to calculate different prices (budgets) for different websites depending on the different options chosen in the form. My last line for this callculation goes like this:
document.getElementById("resultado").value = total + total_check + ' euros';
1.- Should I have specified through parseInt or parseFloat ("total" variable might result on a decimal value depending on the options chosen in the form), somewhere earlier in the code, that "total" and "total_check" variables would be numeric values used for mathematical operations or is it possible to do it in this last line of code alone?
2.- If it can be done in this last line, how exactly should this last line look like?
Thx very much in advance.