Currency Conversion

Posted 18 February 2010 - 03:59 PM

I found this code on here while doing a search and would like to be able to use it but it was written in C and I dont know much about that (don't know that much about VB.NET either but trying to learn)

What I do have is a text box where a user enteres a desired number of US dollars to convert to three types of currency. I know how to convert the string entered to an integer so the calculation can take place. What I don't know how to do is modify the above code so that the results will show up in the correct text boxes after each calculation (yes I know I have to convert the integer back to text).

If someone could show me how to do the first Select Case I can figure the rest out. Thanks in advance for any help.

Re: Currency Conversion

Posted 18 February 2010 - 09:20 PM

By dividing from by To you are left with the conversion ratio for the set conversion. It then converts the text in the Amount textbox into a 16 bit integer and multiplies it by the calculated ratio. A double or float would be better to allow converting partial pounds or dollars. It then stores this factor in the variable result.

Re: Currency Conversion

Posted 19 February 2010 - 01:21 PM

Well I've got it working. Thanks to everyones help. One other question. Instead of hard coding the conversion values is there a way to automatically update the rates from a web site that isn't to complicated.

Re: Currency Conversion

Posted 19 February 2010 - 01:23 PM

majaro, on 19 February 2010 - 02:21 PM, said:

Well I've got it working. Thanks to everyones help. One other question. Instead of hard coding the conversion values is there a way to automatically update the rates from a web site that isn't to complicated.