Skip to main content
Jme2712
Participant
Jul 24, 2017 9:37 PM UTC
Answered

Sum of fields 1-14 * 2.20462.

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 is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jul 24, 2017 10:20 PM UTC

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;

4 replies

try67
Community Expert
Community Expert
Jul 24, 2017 9:39 PM UTC

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

Translate
Jme2712
Jme2712Author
Participant
Jul 24, 2017 10:04 PM UTC

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
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jul 24, 2017 10:20 PM UTC

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