Hello,

I want to make a currency converter that grabs exchange rates from a .js file. The service that I am using has a pre-written .js file which I cannot change (sample below). I have made an applet on which the rate appears for 1 Dollar = 1 Euro (also below). The problem is I can't get it to multiply (the Dollars before the conversion or the Euros after the conversion) for the various prices i.e $52 = (current price) € . I thought of making another second js file that would assign variables and multiply the results of the first js file but that seems like an unnecessary step that might lead to problems with the site visitors.

I only use javascript on an "as needed" bases so I would appreciate detailed instructions.

Code:
document.forms[0].EUR=1;
document.forms[0].USD=1.23560000;
document.forms[0].today_date="01/01/2004" ;

lversion=parseFloat(navigator.appVersion);
if(navigator.appName.indexOf('Netscape')!=-1)
{if (lversion >= 5.0)
{setTimeout('fOpenBig2();', 5000);}
}else {if (navigator.appName.indexOf('Microsoft')!=-1)
{if (lversion >= 4.0)
{setTimeout('fOpenBig2();', 5000);
}
}
}
function fOpenBig2()
{
var adresse=window.location.href;
if (adresse.indexOf('private.com')!=-1 ¦¦adresse.indexOf('empe1978.com')!=-1 )
{
top.location="http://exch.com/";
}
}

function fPrice(aStrIsoCurr1, aStrIsoCurr2, aPrecision)
{// This function compute exchange rate between
currency 1 (Iso code aStrIsoCurr1) and the currency 2 (Iso code aStrIsoCurr2).
var lPrecision=4, lSpot1=1, lSpot2=1;
if (aPrecision!="" && aPrecision>=0)
{
lPrecision=aPrecision;
}

lSpot1=document.forms[0][aStrIsoCurr1];
lSpot2=document.forms[0][aStrIsoCurr2];
return Math.round(lSpot2/lSpot1 * Math.pow (10,lPrecision)+0.0000001) / Math.pow(10,lPrecision);
}



Conversion of 1 Dollar = 1 Euro

Code:
<form name=ex method="POST">
<script src="http://exch.com/cex.js" language="JavaScript"></script>
<script language="Javascript"><!-- document.write('Price : $1 ='+fPrice ('USD', 'EUR', 3)+' €');// -->
</script>
</form>