Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mathmeticians, Please help!
Message
 
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:
00350916
Views:
20
lnMargin =ROUND((tnPrice-tnCost)/max(tnCost,tnPrice)*100,1)

>I have an application that currently uses the following formula for calculating the margin on an item sold:
>
>lnMargin = ROUND((1-(tnCost/tnPrice)) * 100,1)
>
>The problem is that we have customers entering tncost > tnPrice to create a negative margin/loss leader situation. In this case, the returns from the function are huge and cause an overflow.
>
>Can someone tell me or show me a formula that will calculate negative margins correctly?
>
>Thanks..
Doru
Previous
Reply
Map
View

Click here to load this message in the networking platform