title: How can i calculate result from two function on Javascript?
body: <p>so im a rookie. And wanna ask why i cant calculate the result from two functions?
  I want to save value from quantitiy on banyak() function.
  And i have the formula to calculate form which is to get input width,height,length (its a volume rectangular prism)
  The result is... Result +Nan.. I want result from banyak() is number so i can calculate with the result from mult().
  can anyone help me?
  and by the way this is just testing code..</p>
  <pre><code>    function banyak(value){
     var qty = value;
    return qty;
     var cobaQty= document.getElementById('cobaQty');
     cobaQty.textContent=qty;
         }
         
         
  function mult(pj,lb,tg){
            var isipj=pj;
            var isilb=lb;
            var isitg=tg;
            var hasil=isipj*isilb*isitg;
          
        
          //declare variable untuk panjang B1 dan lebar B1
          var vb1 = 0.4;
          var pb1 = parseFloat(pj)+parseFloat(vb1);
          var lb1 = parseFloat(lb)+parseFloat(vb1);
  
          //declare variable untuk panjang B2 dan lebar B2
          var vb2 = 0.7;
          var pb2 = parseFloat(pb1) + parseFloat(vb2);
          var lb2 = parseFloat(lb1)+parseFloat(vb2);
  
  
          //RUMUS B1
          var rumuspjb1= (parseFloat(tg)*2) + parseFloat(pb1);  
          var rumuslbb1= (parseFloat(tg)*2) + parseFloat(lb1);
   
          //RUMUS B2
          var rumuspjb2= (parseFloat(tg)*2) + parseFloat(pb2);  
          var rumuslbb2= (parseFloat(tg)*2) + parseFloat(lb2);
          
          //Mendapatkan perbandingan B1
          var panjangplanoB = 75;
          var lebarplanoB = 65;
          var b1p1 = parseFloat(panjangplanoB) / parseFloat(rumuspjb1);
          var b1p2 = parseFloat(lebarplanoB) / parseFloat(rumuspjb1);
          var b1lb1 = parseFloat(panjangplanoB) / parseFloat(rumuslbb1);
          var b1lb2 = parseFloat(lebarplanoB) / parseFloat(rumuslbb1);
  
          //Mendapatkan perbandingan B2
          var b2p1 = parseFloat(panjangplanoB) / parseFloat(rumuspjb2);
          var b2p2 = parseFloat(lebarplanoB) / parseFloat(rumuspjb2);
          var b2lb1 = parseFloat(panjangplanoB) / parseFloat(rumuslbb2);
          var b2lb2 = parseFloat(lebarplanoB) / parseFloat(rumuslbb2);  
  
          //Mendapatkan hasil B1
          var B1 = b1p1;
            if (B1 &lt; b1p2){     
            var B1 = b1p2;
            }
            if (B1 &lt; b1lb1){     
            var B1 = b1lb1;
            }
            if (B1 &lt; b1lb2){     
            var B1 = b1lb2;
            }
  
            B1 = Math.ceil(B1); //Ini untuk pembulatan. B1 Plano Nanti dikali Rp10000..
  
  
          //Mendapatkan hasil B2
          var B2 = b2p1;
          if (B2 &lt; b2p2){     
            var B2 = b2p2;
            }
            if (B2 &lt; b2lb1){     
            var B2 = b2lb1;
            }
            if (B2 &lt; b2lb2){     
            var B2 = b2lb2;
            }
  
            B2 = Math.ceil(B2); //B2 Plano
  
            //Mendapatkan rumus C1
            var rumusc1p = ((parseFloat(tg) * 4) + 3) + parseFloat(pb1);
            var rumusc1l = ((parseFloat(tg) * 4) + 3) + parseFloat(lb1);
            
            //Mendapatkan rumus C2
            var rumusc2p = ((parseFloat(tg) * 4) + 3) + parseFloat(pb2);
            var rumusc2l = ((parseFloat(tg) * 4) + 3) + parseFloat(lb2);
            
            //Mendapatkan perbandingan C1
            var panjangplanoC = 109;
            var lebarplanoC = 79;
            var c1p1 = parseFloat(panjangplanoC) / parseFloat(rumusc1p);
            var c1p2 = parseFloat(lebarplanoC) / parseFloat(rumusc1p);
            var c1lb1 = parseFloat(panjangplanoC) / parseFloat(rumusc1l);
            var c1lb2 = parseFloat(lebarplanoC) / parseFloat(rumusc1l);
            
            //Mendapatkan perbandingan C2
            var c2p1 = parseFloat(panjangplanoC) / parseFloat(rumusc2p); 
            var c2p2 = parseFloat(lebarplanoC) / parseFloat(rumusc2p);
            var c2lb1 = parseFloat(panjangplanoC) / parseFloat(rumusc2l);
            var c2lb2 = parseFloat(lebarplanoC) / parseFloat(rumusc2l); 
            
            //Mendapatkan C1
            var C1 = c1p1; 
  
              if (C1 &lt; c1p2){     
                var C1 = c1p2;
              }          
              if (C1 &lt; c1lb1){     
                var C1 = c1lb1;
              }
              if (C1 &lt; c1lb2){     
                var C1 = c1lb2;
              }
   
            C1 = Math.ceil(C1); //Ini untuk pembulatan. C1 Plano Nanti dikali Rp10000..
            
            //Mendapatkan C2
            var C2 = c2p1;
            if (C2 &lt; c2p2){     
            var C2 = c2p2;
            }
            if (C2 &lt; c2lb1){     
            var C2 = c2lb1;
            }
            if (C2 &lt; c2lb2){     
            var C2 = c2lb2;
            }
  
            C2 = Math.ceil(C2); //Hasil C2
  
            ////////////////////////////////////////////////////////////////
            //////////////Menghitung biaya bahan dasarnya///////////////////
            ////////////////////////////////////////////////////////////////
            var hargaplanoB=10000;
            var ongkos=7500;
            var hargaplanoC=20000;
            var hargatotalBCO;
            var sumB1 = hargaplanoB / B1;
            var sumB2 = hargaplanoB / B2;
            var sumC1 = hargaplanoC / C1;
            var sumC2 = hargaplanoC / C2;
            var hargatotalBCO = parseFloat(sumB1) + parseFloat(sumB2) + parseFloat(sumC1) + parseFloat(sumC2) + parseFloat(ongkos);  
            hargatotalBCO = Math.ceil(hargatotalBCO);
            var banyakqty=banyak();
  
            document.getElementById('rupiah').value = 'Rp. '+hargatotalBCO+(+banyak());
      }
  
  
  
  </code></pre>
  <p>here's the <a href="https://jsfiddle.net/hcft3d0n/" rel="nofollow noreferrer">JSFiddle</a></p>