# Forgetting something with my functions

**URL:** <https://forum.kirupa.com/t/forgetting-something-with-my-functions/306179>\
**Category:** Uncategorized\
**Created:** [March 10, 2010, 9:51pm UTC](https://forum.kirupa.com/t/forgetting-something-with-my-functions/306179 "2010-03-10T21:51:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![boebarl1](https://avatars.discourse-cdn.com/v4/letter/b/3e96dc/32.png) [@boebarl1](https://forum.kirupa.com/u/boebarl1)\
**Post date:** [March 10, 2010, 9:51pm UTC](https://forum.kirupa.com/t/forgetting-something-with-my-functions/306179/1 "2010-03-10T21:51:31Z")

</div>

I wrote this java script code for a program that will convert an inputed temperature to celsius. I have it all done, but one thing seems to be wrong because when I type in 78 dg. fahrenheit, it converts it to 46 dg. celsius and that isn’t right. I want my code to take the users input # and subtract 32 from it, and then multiply that number by .55? Here is my code, if someone can see what I did wrong, please give me a tip. I am just missing one thing and it is good to have some fresh eyes look at it. Thanks alot.

boebarl1

\<script type = “text/javascript”\>

var fahrTemp;

var fahrTemp = window.prompt( “Please enter the Current Temperature in fahrenheit.” );

document.writeln( “\<h1\> The current Temperature is " + fahrTemp + " Degrees Fahrenheit.\</h1\>” );

document.writeln( “\<h2\> Click the button below to see the Current Temperature in Celsius.\</h2\>” );

function popup(){

function conversion( x ) {  
return fahrTemp - 32;  
function run ( y ){ return fahrTemp \* .55; }  
}

alert(“The current Temperature is " + conversion( fahrTemp) + " Degrees Celsius” )

}  
\</script\>  
\</head\>  
\<body\>  
\<input type=“button” onclick=“popup()” value=“Temperature Conversion” \>  
\</body\>  
\</html\>
