Login | Register | FAQ
Anonymous

A currency question

+ Post a reply

Page 1 of 1


A currency question

by merlin » Wed Feb 29, 2012 7:20 pm

Hi everyone

Having decided that I’ve pushed my HTML project as far as I want to take it at the moment I decided that I needed to learn both JavaScript and and the new HTML 5 in order to “move on”.

Starting at the bottom of the pile again is a bit daunting but I’m enjoying stretching the “OLD” brain cells again. however, the odd brick wall is proving a bit of a bind

If anyone can help solve a bit of a glitch that I’ve come up against I’d be really grateful.

The code in question ( which combines both HTML 5 and JavaScript ) is this :-

<!DOCTYPE html>

<html lang=en>
<head>
<title>test H5 and SCRIPT</title>
<meta charset=utf-8>
<link rel="stylesheet" href="stylesheet.css">
<style>
</style>
</head>

<body style="background:#ffdab9";>

<script>
function XYZ(num1,num2)
{
return num1+num2;
}

var wtotal=(171.50+122.40+((230.06*12)/52));
var mtotal =((wtotal*52)/12);

var text1="total weekly = £"+wtotal+"<br />";
var text2="total monthly = £"+mtotal+"<br />";

document.write(text1);
document.write(text2);

</script>
</body>
</html>

Everything works fine when I run this except for one thing.
Instead of the £ sign in the text I get a black diamond symbol containing a question mark. If I replace it with the dollar sign then it works fine.

( I suspect a Yankee conspiracy :-))

I’ve checked the usual suspects.
My keyboard and Windows 7 OS are configured for the UK. Indeed, the £ sign is not a problem except in this instance.

As a newbie - AGAIN ! – Any suggestions for getting the GB pound back as a viable currency would be appreciated.

Thanks
Merlin
User avatar

merlin

  • Posts: 36
  • Joined: Sun Dec 19, 2010 3:31 pm

Re: A currency question

by merlin » Wed Feb 29, 2012 11:07 pm

Hi CubeSquare

The U.S cavalry comes to the rescue again. Or should that be the Forest Rangers?

Your solution works perfectly. Many thanks not, of course, for the first time – far from it!

Now all I have to do now is figure out how to cut the results down to two decimal places. I have downloaded an explanation of how to do it and, eventually, I’m hoping it wont look as intimidating as it does right now.

It may have a long time but I’m still keeping the plot waiting.
Take care

Merlin
User avatar

merlin

  • Posts: 36
  • Joined: Sun Dec 19, 2010 3:31 pm


+ Post a reply

Page 1 of 1