Skip to main content
Jme2712
Participant
July 24, 2017
Answered

Sum of fields 1-14 * 2.20462.

  • July 24, 2017
  • 1 reply
  • 446 views

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

This topic has been closed for replies.
Correct answer try67

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;

1 reply

try67
Community Expert
Community Expert
July 24, 2017

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

Jme2712
Jme2712Author
Participant
July 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

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 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;