How to sum POST variables?

Hi
I am trying to do a sum on an update in SC, I have a set value and I want it to take the post inputs, and use one value added to the sum of the other two

{{$_POST.totalcost + ($_POST.unit_cost * $_POST.units)}}

but of course the + symbol doesn’t work in this context, is there a way to do this? I have tried a few things now without any luck.

Thanks
Darren

hello @dazmaster9
convert it to the number before sum process then try again

hi, it is (I think)

thanks

Use the To Number formatter for each of the POST vars. So your code becomes:

{{$_POST.totalcost.toNumber() + ($_POST.unit_cost.toNumber() * $_POST.units.toNumber())}}
1 Like

brilliant thanks, that worked :slight_smile: