Exponents in compound expression


#1

I am trying to write an expression with an exponent operator and not having success. I tried " ^ " and " ** ". Here is my file, you’ll find the formula in the onClick for the Calculate button…calculator-1screen.rp (2.0 MB)


#2

Hi,
Math.pow() should do the job :slight_smile:

V7 Variables List for more.

edit: You’re formula have 2 grammatical problems.

The “$” at the start shouldn’t be there
The “/ month” should be inside [[ ]] brackets. In fact everything outside bracket will be interpreted as pure string.
ie. [[ 4 + 2 ]] + 3 will output the string : " 6 + 3 "

At the end it should look like :
[[Math.pow( YourFormula , Term ) / Month]]


#3

thank you so much for your help!


#4

I am almost there…for some reason I’m getting NaN for my last line item, Est Total Interest. any suggestions? calculator-1screen.rp (2.0 MB)


#5

You’re adding a dollar sign to the totalOfPayments variable which you then using for more calculation. Since the variable has a non-numeric character it is not considered a number, resulting in NaN (not a number) since you can’t do math on something isn’t a number.

When you set the totalOfPayments variable, don’t add the dollar sign, only the numeric part. Here’s where it’s going wrong, you’re setting it to:

$[[ term*monthlyPayment ]]

Instead add the dollar sign when you’re setting the text of the display, not in the value of the variable.

Tip, in the preview hit the Console tab in the sitemap and you can see all the current variable values.


#6

thank you! great catch and recommendation re: the console!


closed #7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.