facebook

Clearing Total Fields

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #327679 Reply

    Hello:

    I have a screen below that calculates a total, an annual average and a daily average. Those are all working fine. I am having trouble clearing the input fields on the annual avg and the daily avg. I am coming up with “NaN” in those fields. I have tried moving the code for the clear fields around to no avail.

    Can anyone help?

    Thank you.

    Celeste

    Attachments:
    You must be logged in to view attached files.
    #327846

    Hi Celeste,

    I suggest you to use a if/else sentence to handle the infinity/nan issue. I made this modifications in your updateAverageDaily function:

    
    if(ann4==0){
      $('#m1-ANNUALSales-averageDailyText').text("");
    }
    else{
    //compute average of anns
      davg = sum / ann4;
    
      //display averageDaily
      $('#m1-ANNUALSales-averageDailyText').text(davg);
    }

    you should do the same for the updateAverageAnnually function. Let me know if this is helpful for you.

    #327856

    Hi Octavio:

    Did you actually input the code in the zip file that I attached? I don’t see the If/Else code in the custom file. I tried inputting it but I must be doing something wrong because it is not working for me.

    Thanks for your help.

    Celeste

    #327883

    Hi CelesteP,

    I attached here the custom.js file that I modified on your project.

    Attachments:
    You must be logged in to view attached files.
    #327897

    Hi Octavio:

    I cannot open or save this file (AnnualSales_custom.js). It gives me an error. Can you insert it into my file and zip and send? Says there is a runtime error.

    Thank you.

    Celeste

    #327928

    Hi CelesteP,

    Attached your entire project with the changes suggested previously.

    Attachments:
    You must be logged in to view attached files.
Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Clearing Total Fields

You must be logged in to post in the forum log in