Skip to main content
Participating Frequently
October 16, 2016
Pregunta

Help! help! How come Math pow( ) cannot work on this????

  • October 16, 2016
  • 13 respuestas
  • 1617 visualizaciones

Hi, I have no Java Script experience, wanted to create more complex calculation on DC Acrobat Pro, but only know how to perform basic calculation by using simplified script. Please see attached.

assuming I created field for No. of years, Monthly Amount, Total amount (for row of the table)

Here are my script

12*Monthly Amount*Math.pow(1-1.02,No. of years)/1-1.02

12=one year

1.02=interest p.a

But it does not work. Does Math.pow work on acrobat or can I have any simply way to work on this??

Este tema ha sido cerrado para respuestas.

13 respuestas

Participating Frequently
October 16, 2016

Thanks!

This is what i have from the JavaScript Debugger:

ReferenceError: m is not defined

1:Field:Calculate

ReferenceError: m is not defined

1:Field:Calculate

for m is not defined? what does that mean already created the field??

Inspiring
October 16, 2016

You did not access the field properly.

Participating Frequently
October 16, 2016

Thanks for reply.

Retrying on the custom JavaScipt calculation option.

12*m*(Math.pow(1-1.02,S))/1-1.02

m=monthly amount

S=no. of year

but still not working... sorry no experience in using javascript... please..please help.

still not working for both option.

No error messages in the JavaScript console for both simplified and custom option.

Inspiring
October 16, 2016

Use Ctrl +J keys to open the JavaScript console. Bothscripts are generating errors.

In JavaScript you need to access the field object using "getField" and then the value property of the field object.

Inspiring
October 16, 2016

Math.pow cannot be used in the simplified field notation. Yo need to use the custom JavaScript calculation option.

You cannot have blanks, spaces, or special characters in field names using simplified field notatio unless you use the JavaScript Escape character.

Are you getting any error messages in the JavaScript console?