Error with Calculation in Assign Node

 1 Replies
 1 Subscribed to this topic
 32 Subscribed to this forum
Sort:
Author
Messages
tommyg-006
Basic Member
Posts: 11
Basic Member

    Good Morning All,

    We are building an automation that will compile a report of employee wages and their contributions to the 401(k).  We have a query on the QUARTDED table to pull the WAGE_AMOUNT for the 401(k) deductions.  If an amount is found it is assigned to the variable:  Total401kEligibleWagesVar

    From there I have an assign node to perform the following calculation:

    var Total401kEligibleWages=Total401kEligibleWages+Total401kEligibleWagesVar;

    Total401kEligibleWages=Total401kEligibleWages.toFixed(2)

    However, I get a pop-up window that states:

    TypeError:  Cannot find function toFixed in object 0.0000. (Expression #3)

    In the end the calculation comes out to 0 for the employee, which is incorrect.  

    Is there something I am missing in the JavaScript that is causing this error?  This works with no issue on the other calculations that I have in the Assign Node with no issue  Any assistance would be greatly appreciated.  Thanks!

    Kwane McNeal
    Veteran Member
    Posts: 479
    Veteran Member
      Try changing the second line to...

      Total401kEligibleWages=parseFloat(Total401kEligibleWages).toFixed(2)