JS help

Out of context: Reply #5

  • Started
  • Last post
  • 13 Responses
  • uan0

    your script:
    1. definition of function pv.
    2. definition of 2 global vars (amount, choice)
    3. conditional statement: if choice==1 --> amount.valueAsString = nper/rat ((your js doesn't know what nper/rat are at that stage)).
    else amount.valueAsString = call pv function with rate, per, nper, pay and fv ((you would need to put values in there, something like fv(1,2,1,1,1) ))
    4. your function pv is called (as explained in 3 without values). pv gets rate, per, nper values from some field (overwrites what you passed in the call) and defines pay and fv...does nothing else...

    I don't know if this helps a bit, but you have a big mess in your script...
    ...do what Stugoo said. Start with simple, small steps and build up from there.

View thread