Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculate interest rate
Message
De
23/02/2004 16:04:58
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
À
23/02/2004 12:45:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00879962
Message ID:
00880076
Vues:
35
Hi Chuck,

>
>This website had a function to solve for a var. Using the equation I gave you before it could solve every thing exect for the interestrate.
>
>http://www.hostsrv.com/webmab/app1/MSP/quickmath/02/pageGenerate?site=quickmath&s1=equations&s2=solve&s3=basic
>
>So you can look at the other equations to see if it helps or you could create a loop and loop though posible interest rates util you find a match. Something like FOR i = 0 TO 1 STEP .005
>

I ended up iterating through the possible rates like you suggested. I guess that is the only way to get the answer. My code looks something like this:
For lnIntRate = 0 to 1 Step .000001
	If Payment(lnAmtFinan, lnIntRate, lnNumPayments) >= lnPayment
		Exit
	EndIf 
EndFor 

Return lnIntRate
Not the fastest piece of code in the world, but it works. Thanks.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform