 |

This sample application allows you to convert any amount from one
currency into another. It uses M-Script II's built-in currency
conversion routines.
Click here to run the program.
Here is the source:
print( "<title>Islandnet.com Currency Calculator</title>\n" )
print( "<body bgcolor=ffffff>\n" )
if x = form( "amount" )
amount = num( x )
else
amount = 1
endif
if (from = form( "from" )) == 0
from = "CAD"
endif
if (to = form( "to" )) == 0
to = "USD"
endif
n = round( currency( amount, from, to ), 2 )
print( "<form method=post action=/cgi-bin/ms2/mark/fx>\n" )
print( "<table border=0 cellspacing=0 cellpadding=5>\n" )
print( "<tr bgcolor=339966><td align=center colspan=3>" )
print( "<font face=Arial,Helvetica size=+2 color=ffffff>Islandnet.com Currency Calculator" )
print( </font></td></tr>\n" )
print( "<tr bgcolor=eeeecc><td align=center><select name=from>\n" )
currencylist( from )
print( "</select></td>\n" )
print( "<td align=center><font face=arial,helvetica size=+3>" )
print( "</font></td>\n" )
print( "<td align=center><select name=to>\n" )
currencylist( to )
print( "</select></td></tr>\n" )
printf( "<tr bgcolor=eeeecc><td align=center><input name=amount value=%g size=8></td>\n", amount )
print( "<td align=center><font size=+3><input type=submit value=\" = \"></font></td>\n" )
print( "<td align=center><table width=40% bgcolor=0 border=1 cellpadding=3>" )
print( "<tr><td align=right><font color=ffff00 face=arial,helvetica>" )
printf( "<b>%.2f</b>", n )
print( "</font></td></tr></table></td></tr>" )
print( "</form>\n" )
print( "<tr bgcolor=339966><td align=center colspan=3>" )
print( "<font face=arial,helvetica color=ffffff size=-1>\n" )
print( "This information is intended for informational purposes only.<br>" )
print( "Islandnet.com offers no guarantees or warranties regarding the<br> " )
print( "accuracy of these exchange rates. Use at your own risk.<br>" )
print( "Exchange rates are updated every 15 minutes.<br>" )
print( "</td></tr></table>\n" )
|