Acrobat calculation with results maximum

New Here ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

I have a calculation in Acrobat Pro CC

text4 * text5

The results can be <= 250.

TOPICS
Macintosh, PDF forms

Views

917

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Most Valuable Participant , Oct 10, 2017 Oct 10, 2017
Sorry, replace Math.max with Max.min in the code above.

Likes

6 Replies 6
Adobe Community Professional ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

You have not explained what action you want taken if the result is not less than 250.

You can use and "if then statement, or possibly the Math.max method.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

Sorry I did not explain myself well. I have two fields that I am multiplying in Acrobat CC (text4 * text5).This  represents the total my company will pay towards holiday gifts for sales reps, but this amount can not exceed 250. So even if the results is more than 250, the answer can not show more than 250.

Hope this clarifies my problem

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

Use this code as your custom calculation script:

`var v1 = Number(this.getField("text4").value);var v2 = Number(this.getField("text5").value);event.value = Math.max(250, v1*v2);`

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

The calculations starts with a 250 value seem to only calculate the amount over 250.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

Sorry, replace Math.max with Max.min in the code above.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

THANK YOU! Works great.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources