Convert currency (pounds)

This function will take a value in pounds and a country and will convert the pounds to the currency of the country . Note this function has the currency exchange rates of 23/07/2001 , if you wished to use this on your site you would have to update this every day at least . This would be easy to convert so you could convert from dollars to other currencies .

We used the currency exchange info from this site

Valid countries are us , japan , france , italy , canada , germany and australia

Here is our function

<%
'this function converts from a user entered value (pounds)
'and converts into the currency of the country given it then
'converts this and displays this
Function ConvPounds(byVal pounds , byVal country)
Dim dblRate
Select case lcase(country)
Case "us" :
dblRate = 1.41973
Case "japan" :
dblRate = 176.154
Case "france" :
dblRate = 10.7552
Case "italy" :
dblRate = 317475
Case "canada" :
dblRate = 2.19297
Case "germany" :
dblRate = 3.20583
Case "australia" :
dblRate = 2.79862
End Select
ConvPounds = pounds * dblRate
End Function
%>

and here is our test script

<%
'sample usage of the ConvPounds function
'convert 10pounds to US dollars
Response.Write ConvPounds(10 , "us")
Response.Write "<br>"
'convert 25 pounds to german marks
Response.Write ConvPounds(25 , "GeRManY")
%>

 

Half Price Books

Active Server Pages 3.0 By Example

Active Server Pages Solutions

Developing ASP Components

Active Server Pages How-To

Active Server Pages for Dummies with CDROM