Jump to content
  • 0

Using division in forms.


Marshall
 Share

Suggestion

I would really like to see division added to the calculations allowed in forms. It would seem that the coding to allow this must be in Nitro Pro since it does do averages which, of course, requires division by the number of items being averaged. I'd even be happy if I could locate the code or someone who has already confronted this problem. So far Google hasn't helped.

Edited by Marshall
Link to comment
Share on other sites

2 replies to this suggestion

Recommended Posts

  • 0

I do division this way, in the form that i use I have 2 fields one called "ounces" and one called "pounds" and I put this in the custom calculation script box.

1// Obtain the value from the first field
2 var v1 = getField("Ounces").value;
3 // Obtain the value from the second field
4 var v2 = getField("Pounds").value;
5 // Set this field value equal to the difference
6 event.value = v1 / v2;

it pulls the value out of the ounces field "v1" and then the value from the pounds field "v2" and then divides them and returns the result.

Hope that helps,

Mark

  • Thanks 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.