Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mathmeticians, Please help!
Message
De
28/03/2000 06:24:16
 
 
À
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:
00351300
Vues:
19
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform