Expand my Community achievements bar.

SOLVED

If less than zero, then zero

Avatar

Former Community Member

I have a form where I need to subtract two values from another value but it can't show a negative number as the result.

So it's  a -(b+c). If a becomes -10 then I need a script to just show a zero in that total field.

I'm thinking in javascript but I'm still writing it in pig latin. Please help.

1 Accepted Solution

Avatar

Correct answer by
Level 7

I am not sure of the java but in formcalc it would be:

if (a - (b+c) > 0) then

    $ = a - (b+c)

else $ = 0

endif

(in the calculate field of the total box)

View solution in original post

2 Replies

Avatar

Correct answer by
Level 7

I am not sure of the java but in formcalc it would be:

if (a - (b+c) > 0) then

    $ = a - (b+c)

else $ = 0

endif

(in the calculate field of the total box)