Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

arithmetic over/underflow

AKI15A9
Level 1
Level 1

I am getting over/underflow error, below is the formula and related values:

 

UtilizedContractValue = 0

ApprovedContractValue = 0

 

$=(UtilizedContractValue/ApprovedContractValue)

 

When you open the form both values are zero initially.

 

Need help to resolve it trough 'FormCalc' 

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

Divide by zero is not a valid case, you will always get exception.

You need to put a check, in case the divisor is 0

https://experienceleaguecommunities.adobe.com/t5/adobe-livecycle-discussions/help-divide-by-zero-err...

View solution in original post

6 Replies
Veena_Vikram
Community Advisor
Community Advisor

@AKI15A9 Can you please let us know which tool you are using ? Doesn't seem to be an issue related to AEM 

 

@kautuk_sahni 

Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

Divide by zero is not a valid case, you will always get exception.

You need to put a check, in case the divisor is 0

https://experienceleaguecommunities.adobe.com/t5/adobe-livecycle-discussions/help-divide-by-zero-err...

View solution in original post

AKI15A9
Level 1
Level 1
Thank You, but I am still getting error. Maybe my script has mistake. Can you suggest a script?
Arun_Patidar
Community Advisor
Community Advisor

can you try like

 

if ( ApprovedContractValue > 0 ) then (UtilizedContractValue/ApprovedContractValue) endif

 

check the guide at https://helpx.adobe.com/pdf/aem-forms/6-2/formcalc-reference.pdf