Calculation App doesn't seem to want to subtract numbers
Hi everyone,
I'm trying to undertake what I'd assume to be a simple calculation, using a Calculation app, which references a couple of other fields. But for some reason, it won't subtract.
Heres what I'm attempting to do  possibly it'll make more sense that trying to explain verbally:
"$ " + (@Field1 * @Percentage)  (@Field2 + @Field3)
I'd expect to obtain a percentage of the "Field1" number from the results from the first brackets, and then I'd add Field2 & Field3 together, and subtract the result of that calculation from the first bracketed result to obtain my end result.
I'm using the "$" symbol at the start, as I'll need to use the figure in this field elsewhere, and it needs to have a currency symbol at the front of the resulting number.
Any help greatly appreciated.

Hi Steve,
you mix up text and numbers. So you have to separate text and numbers.
You can wrap the number calculation in additional brackets:
"$ " + ((@Field1 * @Percentage)  (@Field2 + @Field3))
or let the number calculation run in a variable:
var sum = (@Field1 * @Percentage)  (@Field2 + @Field3);
"$" + sumRainer

Ranier, as usual your reply worked perfectly. Many thanks.
If I could ask one further question  the result is showing as a number without the correct formatting ($5000). Is there a method to add further to the calculation field so that the formatting is correct, and / or changing the amount of decimal places included in the result?
I'd like to see something like: $5,000, $10,000, or $5,000.00 etc.
Thanks for your continued response.
Please sign in to leave a comment.
Comments
4 comments