• Global community
• Language:
• Deutsch
• English
• Español
• Français
• Português
• 日本語コミュニティ
Dedicated community for Japanese speakers
• 한국 커뮤니티
Dedicated community for Korean speakers
Exit
• Multiply sum of several number fields with another...

# Multiply sum of several number fields with another value when checkbox on

New Here ,
Mar 04, 2024 Mar 04, 2024

Copied

I have a receipt form with many number fields. I need a field "Card Fee" to contain the product of 0.05 by the sum of four other fields when the "Charge" checkbox is ticked.  Many times only one of these summed fields ("Parts") will contain a value, which is the sum of several other fields, if that matters.

The breakdown of the equation is:

("Core Due" + "Parts"  + "Service" + "Shipping") * 0.05 = "Card Fee"

TOPICS
How to , PDF

Views

72

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 Expert ,
Mar 04, 2024 Mar 04, 2024

Copied

LATEST

Use this as custom calculation script of "Card Fee" field:

``````var f1 = Number(this.getField("Core Due").valueAsString);
var f2 = Number(this.getField("Parts").valueAsString);
var f3 = Number(this.getField("Service").valueAsString);
var f4 = Number(this.getField("Shipping").valueAsString);
var check = this.getField("Charge").valueAsString;
var total = (f1+f2+f3+f4)*0.05;

event.value = (check === "Off") ? "" : total;``````