JQuery each count result error -


I have a button that ends with the last tr in a table. Every time this happens, it is used to work together using the mainTotalCalc () .

Total .each is used and classes are used.

This problem occurs when I reach a final line balance. The total will be in the form of the last total it never gets. 0.00

Now I think I can see why, because JQ considers the last total in each variable.

I fully calculate that I am stuck about how to overthrow the last remaining line.

JS / JQ

  function mainTotalCalc () {/ p> 

var activetableID = $ ( "li.till_table_button. active"). attr ('id'); // Alert (active); Var Tableclerk = $ ("#" + Activation). Data ("TableRF"); // Alert (Tablenumber); // test var newtotal = 0, total = 0; $ ('._______' + tablenumber + '_ row__totalprice'). Each (function (i) {var number = $ (this) .text (); // warning (content); // num = parseInt (number); num = ParseFloat (number); newtotal + = num; // alerts (Number); // test totalpriceDecimal = newtotal.toFixed (2); $ ('# till__totalpanel_table _'+ tabomber +' _ price '). Html (newtotal.toFixed (2)); // warning (totalpriceDecimal); i ++;}); }

before the final zero Before zero

After the last zero (total should remain in 1.00 and should not be)  after zero

If there are no more lines, then a guard position Set:

  if ($ ('._______________________' _ '=) 0 ($ #);' html '(' 0.00 ');   



Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -