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

911

Likes

translate

Translate

Translate

Report

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

correct answers 1 Correct Answer

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

Likes

translate

Translate

Translate
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

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
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

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
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

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
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.Screen Shot 2017-10-10 at 10.10.30 AM.pngScreen Shot 2017-10-10 at 10.09.23 AM.png

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
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

translate

Translate

Translate

Report

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

Copy link to clipboard

Copied

THANK YOU! Works great.

Likes

translate

Translate

Translate

Report

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