-2

i am working with php ,i need to how to round off number upto two decimcal place.i want that after multiplication of two number ,when this result is used further it will take upto two decimal place ,i am working dynmically in javascripting here is the code

<script>
   function getText3(){
      var in1=document.getElementById('in1').value;
      var in2=document.getElementById('in2').value;
        var in4=document.getElementById('in4').value;
      var in3=(in1*in2*in4*30)/1000;
      document.getElementById('in3').value=in3;
   }
    function getText39(){
      var in1=document.getElementById('in1').value;
      var in2=document.getElementById('in2').value;
        var in4=document.getElementById('in4').value;
      var in39=((in1*in2*in4*30)/1000)*7.50;
      document.getElementById('in39').value=in39;
   }
     function getText89(){
      var in1=document.getElementById('in1').value;
      var in4=document.getElementById('in4').value;
        var comboB=document.getElementById('comboB').value;
      var in89=in1*in4;
      document.getElementById('in89').value=in89;
   }

i want the result in var in39,var in89,var in3 is upto two decimal place plz help me i realy need this

Anthony Sottile
  • 40,161
  • 9
  • 79
  • 122
malika
  • 1
  • 4

1 Answers1

0

Take a look at toFixed(digits).

Vivin Paliath
  • 87,975
  • 37
  • 202
  • 284