Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Sum of fields 1-14 * 2.20462.

New Here ,
Jul 24, 2017 Jul 24, 2017

All,

I am trying to figure out how to sum fields 1-14 and then multiply that by 2.20462 essentially the sum of kilograms and then convert it to lbs. Is there a way to do this?

Thanks,

-J

TOPICS
Acrobat SDK and JavaScript , Windows
397
Translate
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

Community Expert , Jul 24, 2017 Jul 24, 2017

Use this code as your custom calculation script:

var total = 0;

for (var i=1; i<=14; i++) {

    var f = this.getField("10 MARKED WEIGHT OF LOTRow"+i);

    total+=Number(f.value);

}

event.value = total * 2.20462;

Translate
Community Expert ,
Jul 24, 2017 Jul 24, 2017

Are the field names actually "1", "2", "3"... "14"?

Translate
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 ,
Jul 24, 2017 Jul 24, 2017

Sorry the fields are 10 MARKED WEIGHT OF LOTRow1-10 MARKED WEIGHT OF LOTRow14 and I would like to have the final amount in LBS calculated in field 10 MARKED WEIGHT OF LOTRow15

Translate
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
Community Expert ,
Jul 24, 2017 Jul 24, 2017

Use this code as your custom calculation script:

var total = 0;

for (var i=1; i<=14; i++) {

    var f = this.getField("10 MARKED WEIGHT OF LOTRow"+i);

    total+=Number(f.value);

}

event.value = total * 2.20462;

Translate
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 ,
Jul 24, 2017 Jul 24, 2017
LATEST

Simply amazing. I wish I know programming. You're 2 for 2! Thank you!

Translate
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