Expand my Community achievements bar.

Help with percentages

Avatar

Former Community Member
I have a form where I need to add the dollar amounts for projected small business spend and large business spend. (which is entered by the user) Then, actual cumulative smal and large spend is also entered by the user.



I need to know how to write the script for calculating the percentage of cumulative spend in relation to projected spend.



cumulative spend = % of projected spend

Projected spend = 200.00

50.00 is what % of 200.00



This is my current code:



if (TotalCurrent <> 0)



then

SmallActualCurrentPerc=(SmallActual / TotalCurrent) * 100

else

0

endif



I have a few problems:

I need to display the result as a decimal percent

I need to add code that says SmallActual <> 0 as well. How?

Please Help
0 Replies