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

Formcalc help

Avatar

14-05-2008

I'm trying to "wing it" to create a calculation. I have zero experience with this and noone to ask at work. This calculation is in a mechanical permit. The Total is determined by the number of feet x .05/ft. Minimum amount is $25. I have the fields of Items and a field of Totals. I have been able to get the calculation to work when the field has a number input, however I can't get the calculation to work when a "0" is input. Here is what I have so far.



if ((Items[36] * .05) < 25) then

Totals = 25

elseif ((Items[36] * .05) > 25) then

Totals = (Items[36] * .05)

elseif ((Items[36] * .05) < 0) then

Totals = 0

endif



I may not be going about it correctly, but this is what I've been able to come up with so far. Any help is greatly appreciated!

Replies

Avatar

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct Reply

0 solutions
View profile

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct Reply

0 solutions
View profile
_SekharN_
Level 5

14-05-2008

Try this....you are just missing one '=' in the test condition on the second elseif.

if ((Items[36] * .05) < 25) then

Totals = 25

elseif ((Items[36] * .05) > 25) then

Totals = (Items[36] * .05)

elseif ((Items[36] * .05) <= 0) then

Totals = 0

endif

Avatar

15-05-2008

Unfortunately that didn't work. I still have 25.00 in the Total column even when entering 0 as Item amount.

Avatar

15-05-2008

I was able to get it to work...I switched the if with the last elseif.



if ((Items[36] * .05) <= 0) then

Totals = 0

elseif ((Items[36] * .05) > 25) then

Totals = (Items[36] * .05)

elseif ((Items[36] * .05) < 25) then

Totals = 25

endif