noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 02/20: Task #1187 - Problème avec la CA - to


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 02/20: Task #1187 - Problème avec la CA - totaux inégaux #0001187 : rounded problem
Date: Sat, 24 Oct 2015 21:44:57 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 148f0279e1aa05b86bfb865c6f4bf24cc3632a36
Author: Dany De Bontridder <address@hidden>
Date:   Fri Oct 23 12:23:12 2015 +0200

    Task #1187 - Problème avec la CA - totaux inégaux
    #0001187 : rounded problem
---
 html/js/anc_script.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/html/js/anc_script.js b/html/js/anc_script.js
index 5087109..3e1351f 100644
--- a/html/js/anc_script.js
+++ b/html/js/anc_script.js
@@ -79,10 +79,12 @@ function compute_total_table(p_table, seq)
         var i = 0;
         var tot = 0;
         var col = document.getElementsByName("val[" + seq + "][]");
+        var rounded_value = 0 ;
         for (i = 0; i < col.length; i++)
         {
             if ( $(p_table).contains(col[i])) {
-                tot += parseFloat(col[i].value);
+                rounded_value = parseFloat(col[i].value);
+                tot += Math.round(rounded_value*100)/100;
             }
         }
         return tot;
@@ -156,6 +158,7 @@ function verify_ca(div)
                     total_amount += parseFloat(array_value[i].value);
                 }
                 var amount = Math.abs(parseFloat(g('amount_t' + idx).value));
+                amount = Math.round(amount*100)/100;
                 var diff = amount - total_amount;
 
                 if (Math.round(diff, 2) != 0.0)
@@ -282,6 +285,7 @@ function caod_checkTotal()
         {
             amount = 0.0;
         }
+        amount = Math.round(amount*100)/100;
         if (side.checked == false)
         {
             total_cred += amount;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]