Home › Forums › JavaScript › Changing currency with the editable invoice › Re: Changing currency with the editable invoice
March 26, 2010 at 2:08 am
#72978
Member
You should post a little bit of code next time.
I’m assuming you want to have javascript functions that convert from dollars to pounds, and back.
Code:
function dollarsToPounds(dollars) {
return dollars * [i]conversion rate to pounds[/i];
}
return dollars * [i]conversion rate to pounds[/i];
}
function poundsToDollars(pounds) {
return pounds * [i]conversion rate to dollars[/i];
}
Then, anytime you use it, just make a function call like:
Code:
var moneyInPounds = 10;
var moneyInDollars = poundsToDollars(moneyInPounds);
document.write(moneyInDollars);
var moneyInDollars = poundsToDollars(moneyInPounds);
document.write(moneyInDollars);