Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Changing currency with the editable invoice Re: Changing currency with the editable invoice

#72978
Democritus
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];
}

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);