Currency Converter

How to make a currency converter

Page 1 of 1

1 Replies - 10577 Views - Last Post: 18 April 2009 - 07:25 AM Rate Topic: -----

#1 spurr369  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-April 09

Currency Converter

Posted 18 April 2009 - 06:59 AM

I am trying to make a currency converter but i have forgotten how to do it.
I am looking to convert at least 10 currencies from combo boxes.

If cboConvertfrom.Text = "British - Pounds" Then
			Currency = GBP(0)
		End If
		If cboConvertfrom.Text = "US - Dollars" Then
			Currency = US(0)
		End If



this is only part of the code as there is 10 currencies

I have created a module with the following code in
  Public GBP(1) As Decimal
	Public US(1) As Decimal
and so on

I am looking to have a text box were people insert a number then select which currency to convert from and to and display it in another text box or label
Thanks for the help in advance
Tom

Is This A Good Question/Topic? 0
  • +

Replies To: Currency Converter

#2 searockruz  Icon User is offline

  • D.I.C Regular

Reputation: 24
  • View blog
  • Posts: 460
  • Joined: 07-March 09

Re: Currency Converter

Posted 18 April 2009 - 07:25 AM

well use switch in this condition because you will get tired writing if and else
Dim from,to as integer
select case cboConvertfrom.Text
case "British - Pounds" :
from=0.765811
case "US - Dollars" :
from=1
end select


select case cboConvertTo.Text
case "British - Pounds"
to=0.765811
case "US - Dollars"
to=1
end select

dim result as integer

result=from/to * Convert.ToInt16(txtAmount.Text)


Was This Post Helpful? 1
  • +
  • -

Page 1 of 1