i need a small help.

Discussion in 'JavaScript' started by baris22, Jan 31, 2010.

  1. #1
    hello,

    i know php but i have got no knowledge on ajax. this is the function my programmer made long time ago. it is showing the total value on the text areas. The problem am facing now is:

    forexample if the value on the field is: 1.50 it turns into 1.

    What can i do to solve the problem. i think it is something to do with parseInt

    
    
    function amtTot(){
    
    	//fee_tot1
    	//alert(document.getElementById("fee_tot1").value);
    	var tot_amt=parseInt(document.getElementById("fee_tot1").value)+parseInt(document.getElementById("fee_tot2").value)+parseInt(document.getElementById("fee_tot3").value)+parseInt(document.getElementById("fee_tot4").value)+parseInt(document.getElementById("fee_tot7").value)+parseInt(document.getElementById("fee_tot8").value);
    	//alert(tot_amt);
    	document.getElementById("tot_amt").value=tot_amt;
    	addValueText();
    	//tot_amt
    }	
    
    
    Code (markup):
    thanks all.
     
    baris22, Jan 31, 2010 IP
  2. baris22

    baris22 Active Member

    Messages:
    543
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #2
    ok. sorted. I changed parseInt into parseFloat
     
    baris22, Jan 31, 2010 IP