Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Highlighted

Explorer
,

Aug 13, 2020

Copy link to clipboard

Copied

If possible, how to do it pls?

Engaged

Use this:

var x = Number(this.getField("Rating").value);

var x2 = Math.pow(x, 2);

var al = Number(this.getField("AreaLevel").value);

var al2 = Math.pow(al, 2);

var hf = (.1*x)+(.001*x2);

var lf = 10+(.5*al)+(.05*al2);

var f = (hf/lf)+1;

var f1 = (1/f);

event.value = (1-f1)*.8;

EDIT: if you want it to be more precise use this:

var x = Number(this.getField("Rating").value);

var x2 = Math.pow(x, 2);

var al = Number(this.getField("AreaLevel").value);

var al2 = Math.pow(al, 2);

var hf = (.1*x)+(.001*x2);

var lf = 10+(.5*al)+(.05*al2);

var f = (hf/lf)+1;

var f1 = (1/f);

if(al<15){

event.value = (1-f1)*.797;

}else if(al<27){

event.value = (1-f1)*.787;

}else if(al<34){

event.value = (1-f1)*.775;

}else if(al<43){

event.value = (1-f1)*.767;

}else if(al<48){

event.value = (1-f1)*.758;

}else if(al<60){

event.value = (1-f1)*.749;

}

TOPICS

Acrobat SDK and JavaScript,
How to

Community Guidelines

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

Explorer
,

Aug 13, 2020

Copy link to clipboard

Copied

If possible, how to do it pls?

Engaged

Use this:

var x = Number(this.getField("Rating").value);

var x2 = Math.pow(x, 2);

var al = Number(this.getField("AreaLevel").value);

var al2 = Math.pow(al, 2);

var hf = (.1*x)+(.001*x2);

var lf = 10+(.5*al)+(.05*al2);

var f = (hf/lf)+1;

var f1 = (1/f);

event.value = (1-f1)*.8;

EDIT: if you want it to be more precise use this:

var x = Number(this.getField("Rating").value);

var x2 = Math.pow(x, 2);

var al = Number(this.getField("AreaLevel").value);

var al2 = Math.pow(al, 2);

var hf = (.1*x)+(.001*x2);

var lf = 10+(.5*al)+(.05*al2);

var f = (hf/lf)+1;

var f1 = (1/f);

if(al<15){

event.value = (1-f1)*.797;

}else if(al<27){

event.value = (1-f1)*.787;

}else if(al<34){

event.value = (1-f1)*.775;

}else if(al<43){

event.value = (1-f1)*.767;

}else if(al<48){

event.value = (1-f1)*.758;

}else if(al<60){

event.value = (1-f1)*.749;

}

TOPICS

Acrobat SDK and JavaScript,
How to

Community Guidelines

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

Marietaa

Aug 13, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/td-p/11357647
16
Replies
16

Adobe Community Professional
,

Aug 13, 2020

Copy link to clipboard

Copied

Yes it is possible with the Math functions.

Community Guidelines

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

Reply

Loading...

Bernd Alheit

Aug 13, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11357764#M270730
Most Valuable Participant
,

Aug 13, 2020

Copy link to clipboard

Copied

There's nothing special about this formula. The only operator that's a bit different is the square ("power of two") one, which can be done in JS using the pow (power) function of the Math object, like this:

Math.pow(x,y)

With y being 2 in this case.

The rest is just normal math operators ( + - / * ), and possibly parentheses.

Community Guidelines

Reply

Loading...

try67

Aug 13, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11358900#M270864
Explorer
,

Aug 24, 2020

Copy link to clipboard

Copied

Hi, guys I still need help with this one, I was trying to figure it out but I'm stuck how to get this into code.

field1 is dodge rating and field2 is area level

and in field3 should be calculated percentage.

I'v gathered some info on the net so hopefully some1 can help me pls.

this is info i got so far:

calculator: https://www.desmos.com/calculator/b7s5aqep3b

original info: https://lastepoch.gamepedia.com/Dodge

and here are some examples:

Thanks in advance 🙂

Community Guidelines

Reply

Loading...

Marietaa

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11382809#M272618
Most Valuable Participant
,

Aug 24, 2020

Copy link to clipboard

Copied

If you're interested I could write the script for you that does this calculation, for a small fee.

You can contact me privately via [try6767 at gmail.com] to discuss it further.

Community Guidelines

Reply

Loading...

try67

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11382967#M272631
Explorer
,

Aug 24, 2020

Copy link to clipboard

Copied

Thank you for your offer try67. I was working on javascript myself but I'm not getting any result when using my code.

Can you tell me if i'm on right track at least?

var x = Number(this.getField("Rating").value);

var x2 = Math.pow(x, 2);

var al = Number(this.getField("AreaLevel").value);

var al2 = Math.pow(al, 2);

var lf = math.fraction(.1(x)+.001(x2),10+0.5(al)+0.05(al2))+1;

event.value = .8-(math.fraction(.8, lf));

I'm having trouble writing .001x2 getting "identifier starts immediately after numeric literal" so i used

parentheses but I don't think it's the right way.

Community Guidelines

Reply

Loading...

Marietaa

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383160#M272645
Adobe Community Professional
,

Aug 24, 2020

Copy link to clipboard

Copied

To multiply values use *:

E.g. 0.001 * x2

Community Guidelines

Reply

Loading...

Bernd Alheit

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383168#M272646
Most Valuable Participant
,

Aug 24, 2020

Copy link to clipboard

Copied

- There's no such thing as math.fraction in core JavaScript.

- JS doesn't allow implicit operators. If you want to multiply two values you have to use the "*" operator between them.

Community Guidelines

Reply

Loading...

try67

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383169#M272647
Explorer
,

Aug 24, 2020

Copy link to clipboard

Copied

Thanks il try with multiply.

I found math.fraction here: https://mathjs.org/docs/datatypes/fractions.html

Community Guidelines

Reply

Loading...

Marietaa

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383181#M272649
Most Valuable Participant
,

Aug 24, 2020

Copy link to clipboard

Copied

Community Guidelines

Reply

Loading...

try67

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383193#M272650
Explorer
,

Aug 24, 2020

Copy link to clipboard

Copied

Thank you guys for help,I sort of got it to work in example: rating 527 and area level 5 i get 75% instead of 77%, also as area level get higher value percentage should be lower and mine is getting higher. any advice?

var x = Number(this.getField("Rating").value);

var x2 = Math.pow(x, 2);

var al = Number(this.getField("AreaLevel").value);

var al2 = Math.pow(al, 2);

var lf = (.1*x+.001*x2,10+0.5*al+0.05*al2)+1;

event.value = .8-(.8/lf);

Community Guidelines

Reply

Loading...

Marietaa

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383217#M272652
Adobe Community Professional
,

Aug 24, 2020

Copy link to clipboard

Copied

Why does you use a comma there:

var lf = (.1*x+.001*x2,10+0.5*al+0.05*al2)+1;

Community Guidelines

Reply

Loading...

Bernd Alheit

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383356#M272665
Explorer
,

Aug 24, 2020

Copy link to clipboard

Copied

I thought I was supposed to.Would that affect anything?

Community Guidelines

Reply

Loading...

Marietaa

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383412#M272669
Most Valuable Participant
,

Aug 24, 2020

Copy link to clipboard

Copied

Community Guidelines

Reply

Loading...

try67

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383485#M272674
Explorer
,

Aug 24, 2020

Copy link to clipboard

Copied

I was trying to separate fractions because if i use / it works even worse.

Community Guidelines

Reply

Loading...

Marietaa

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383631#M272690
Engaged
,

Aug 24, 2020

Copy link to clipboard

Copied

Use this:

var x = Number(this.getField("Rating").value);

var x2 = Math.pow(x, 2);

var al = Number(this.getField("AreaLevel").value);

var al2 = Math.pow(al, 2);

var hf = (.1*x)+(.001*x2);

var lf = 10+(.5*al)+(.05*al2);

var f = (hf/lf)+1;

var f1 = (1/f);

event.value = (1-f1)*.8;

EDIT: if you want it to be more precise use this:

var x = Number(this.getField("Rating").value);

var x2 = Math.pow(x, 2);

var al = Number(this.getField("AreaLevel").value);

var al2 = Math.pow(al, 2);

var hf = (.1*x)+(.001*x2);

var lf = 10+(.5*al)+(.05*al2);

var f = (hf/lf)+1;

var f1 = (1/f);

if(al<15){

event.value = (1-f1)*.797;

}else if(al<27){

event.value = (1-f1)*.787;

}else if(al<34){

event.value = (1-f1)*.775;

}else if(al<43){

event.value = (1-f1)*.767;

}else if(al<48){

event.value = (1-f1)*.758;

}else if(al<60){

event.value = (1-f1)*.749;

}

Community Guidelines

Reply

Loading...

Nesa Nurani

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11383974#M272715
Marietaa
LATEST

Explorer
,

Aug 24, 2020

Copy link to clipboard

Copied

Thank you Nesa so much that is working like a charm. Thank you all for helping 🙂

Community Guidelines

Reply

Loading...

Marietaa

Aug 24, 2020
0
/t5/acrobat/can-this-be-calculated-in-acrobat/m-p/11384044#M272725
Resources

About Adobe Acrobat

Adobe Inc

Adobe Inc

Adobe Inc

Adobe Acrobat Feature & Workflow

FAQs

Using the Community
Experience League
Terms of Use
Privacy Policy
Cookie preferences
AdChoices
Language:

- Deutsch
- English
- Español
- Français
- 日本語コミュニティ
- Português

Copyright © 2020 Adobe. All rights reserved.