Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mathmeticians, Please help!
Message
De
27/03/2000 12:13:25
 
 
À
27/03/2000 12:01:02
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00350796
Message ID:
00350802
Vues:
33
>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..

I'm not familiar with (negative) cost margins, but generally speaking I would test for the relative cost/price and use an appropriate formula. E.g.:


IF tnCost <= tnPrice
lnMargin = ROUND((1-(tnCost/tnPrice)) * 100,1)
ELSE
* Put a suitable formula here
* ( or tell them negative margins are not allowed? )
ENDIF

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform