Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mathmeticians, Please help!
Message
From
28/03/2000 06:24:16
 
 
To
27/03/2000 12:01:02
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00350796
Message ID:
00351300
Views:
17
John

Try

If tnPrice-tnCost<0 then

-1*(InMargin=ROUND((1-(tnPrice/tnCost))*100,1))

else

InMargin=ROUND((1-(tnCost/tnPrice))*100,1)

endif

This may not be the correct Foxpro syntax, but hopefully the principles will be there.

Assuming 2.00 cost and 8.00 price, the formula calculates the margin at 75%
Assuming 8.00 cost and 2.00 price, the formula calculates the margin at -75%

I hope that this is what you want, although in terms of economics I cannot comment on whether or not it is correct for the formula to report -75% and not -300%.

Sha
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform