Visualizzazione dei risultati da 1 a 8 su 8

Hybrid View

  1. #1
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,134
    var totale = 1.399999
    totale.toFixed(2) = 1.40
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  2. #2
    Quote Originariamente inviata da cavicchiandrea Visualizza il messaggio
    var totale = 1.399999
    totale.toFixed(2) = 1.40
    Perdona la mia ignoranza, ma dove devo mettere quella cosa che mi hai indicato?
    Questo è il mio codice:

    codice:
    <script type="text/javascript">
    <!-- Begin
    function startCalc(){
    interval = setInterval("calc()",1);
    }
    function calc(){
    art001 = document.autoSumForm.art001.value;
    document.autoSumForm.tot_art001.value = (art001 * 1) * (1.20 * 1);
    
    art002 = document.autoSumForm.art002.value;
    document.autoSumForm.tot_art002.value = (art002 * 1) * (1.20 * 1);
    
    art003 = document.autoSumForm.art003.value;
    document.autoSumForm.tot_art003.value = (art003 * 1) * (1.20 * 1);
    
    art004 = document.autoSumForm.art004.value;
    document.autoSumForm.tot_art004.value = (art004 * 1) * (1.20 * 1);
    
    art005 = document.autoSumForm.art005.value;
    document.autoSumForm.tot_art005.value = (art005 * 1) * (1.20 * 1);
    
    art006 = document.autoSumForm.art006.value;
    document.autoSumForm.tot_art006.value = (art006 * 1) * (1.00 * 1);
    
    art007 = document.autoSumForm.art007.value;
    document.autoSumForm.tot_art007.value = (art007 * 1) * (1.00 * 1);
    
    art008 = document.autoSumForm.art008.value;
    document.autoSumForm.tot_art008.value = (art008 * 1) * (1.00 * 1);
    
    art009 = document.autoSumForm.art009.value;
    document.autoSumForm.tot_art009.value = (art009 * 1) * (0.75 * 1);
    
    art010 = document.autoSumForm.art010.value;
    document.autoSumForm.tot_art010.value = (art010 * 1) * (1.00 * 1);
    
    document.autoSumForm.totale_generale.value = 
    (document.autoSumForm.tot_art001.value * 1) + 
    (document.autoSumForm.tot_art002.value * 1) +
    (document.autoSumForm.tot_art003.value * 1) +
    (document.autoSumForm.tot_art004.value * 1) +
    (document.autoSumForm.tot_art005.value * 1) +
    (document.autoSumForm.tot_art006.value * 1) +
    (document.autoSumForm.tot_art007.value * 1) +
    (document.autoSumForm.tot_art008.value * 1) +
    (document.autoSumForm.tot_art009.value * 1) +
    (document.autoSumForm.tot_art010.value * 1)
    ;
    
    }
    function stopCalc(){
    clearInterval(interval);
    }
    // End -->
    </script>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.