PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08/05/2020 10:45 AM by  Kwane McNeal
Error with Calculation in Assign Node
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
tommyg-006
HRIS Analyst/Project Lead
Private
Basic Member
(17 points)
Basic Member
Posts:11


Send Message:

--
08/05/2020 10:26 AM

    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
    President
    Private
    Veteran Member
    (1410 points)
    Veteran Member
    Posts:470


    Send Message:

    --
    08/05/2020 10:45 AM
    Try changing the second line to...

    Total401kEligibleWages=parseFloat(Total401kEligibleWages).toFixed(2)
    You are not authorized to post a reply.