•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,230 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,204 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 7824 | Replies: 11
•
•
Join Date: Jan 2005
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Hi there,
I'm a complete novice on javascript and am trying to make a basic currency convertor as part of my college course.
I have the beginning sorted, but am struggling to get the code to output the answer.
Can any kind soul tell me where I'm going wrong?
// Aim; to imput an amount in £'s and output in $'s using an exchange rate of 1.78 //
var amountInPounds, amountInDollars, dollarRate;
document.write('Currency Conversion Application A' + '<BR><BR>');
dollarRate = 1.78;
amountInPounds = window.prompt('PLease enter your sterling amount' ,'');
amountinPounds = parsefloat(amountinPounds);
amountInDollars = amountinPounds * dollarRate;
amountinDollars = parsefloat(amountinDollars);
document.write('total is ' + amountinDollars + '<br>');
Any help gratefully appreciated!
Phil
I'm a complete novice on javascript and am trying to make a basic currency convertor as part of my college course.
I have the beginning sorted, but am struggling to get the code to output the answer.
Can any kind soul tell me where I'm going wrong?
// Aim; to imput an amount in £'s and output in $'s using an exchange rate of 1.78 //
var amountInPounds, amountInDollars, dollarRate;
document.write('Currency Conversion Application A' + '<BR><BR>');
dollarRate = 1.78;
amountInPounds = window.prompt('PLease enter your sterling amount' ,'');
amountinPounds = parsefloat(amountinPounds);
amountInDollars = amountinPounds * dollarRate;
amountinDollars = parsefloat(amountinDollars);
document.write('total is ' + amountinDollars + '<br>');
Any help gratefully appreciated!
Phil
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Passing data from forms from one page to another
- Next Thread: New Language combines: Asynchronous JavaScript+CSS+DOM+XMLHttpRequest



Threaded Mode