Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Currency Forumula

Status
Not open for further replies.

hawaiian1975

Programmer
Nov 7, 2003
26
US
I'm writting a program to convert currency from US dollar to whatever and vice versa. Can someone please tell me the math forumla to convert? I am not sure whether I have to divide or multiply.
 
Since multiplying by 2 and dividing by 0.5 are the same thing, the question is really, what numbers do I choose.

Try
--
 
Nice website, but it doesn't tell me a thing on how to convert.
 
well.. it depends on the info you have...

for example if you have:
1 Canadian= 0.8 US

and you want to convert 10 USD to canadain:
10 USD x 1 Canadian/ 0.8 US

if by some freak of nature the canadian dollar is worht more than the USD:

eg: 1US = 0.8 Can
then 10 US is
10 US x 0.8 Can/1US

so, as you can see, it depends on what conversion rate you have and what you want.

you can also set it up to always multiply or always divide, but you have to get the exchange rate in the correct terms.. to do that all you might have to do is take the inverse of the exchange rate. its up to you!

good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top