User Name Password Register
DaniWeb IT Discussion Community
All
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: mr woo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mr woo mr woo is offline Offline
Newbie Poster

currency convertor

  #1  
Jan 20th, 2005
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
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:45 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC