Click to See Complete Forum and Search --> : Celcius to Fahrenheit


dburnham4739
11-20-2003, 07:44 AM
I am receiving a variable that represents a celcius temperature. I need to display this variable as fahrenheit. However, the plot thickens.

The web pages are stored on an Echelon iLon web Server.(Used for Automated Facilities)I am receiving the variable from a temperature sensing unit. The "iLonWeb" code below is interpreted from the web server. The code below says to display (func=ShowValue) the information coming from this address "symbol=NVE_AS:SN.DM:0.SU:2.NO:1.ST:UA.PR:0.AU:0.SY:0.NI:0.NS:0.RY:3.TX:192.TY:105.SZ:2"

<iLonWeb func=ShowValue symbol=NVE_AS:SN.DM:0.SU:2.NO:1.ST:UA.PR:0.AU:0.SY:0.NI:0.NS:0.RY:3.TX:192.TY:105.SZ:2></iLonWeb>

The results are displayed in Celcius. I need to convert and display the data as Fahrenheit.

Any and All Help is Appreciated.
David

olerag
11-20-2003, 07:53 AM
Probably missing what your asking for but the
Celsius -> Farenheit conversion is, I believe,
F = (9/5) + 32

dburnham4739
11-20-2003, 07:59 AM
Thanks, but I am lost on the Java Script code. I was asked to create a web page that will allow this companies management to view/control their lab freezers with a web browser. The issue is that the sensing unit reports in celcius and they want to see Fahrenheit.

I do not know Java Script.

Thanks,
David

olerag
11-20-2003, 08:22 AM
This script permits the user to enter the Celcius temp and
the converion is performed/displayed when the button is
pressed.


<html>
<head>
<script type="text/javascript">
function convert(form) {
var celcius = form.celcius.value;
form.fahrenheit.value = celcius * (9/5) + 32;
}
</script>
</head>
<body>
<center>
<b>Temperature Conversion</b>
<form>
<b>Celcius:</b>&nbsp;&nbsp;<input type="text" name="celcius">
<b>Fahrenheit:</b>&nbsp;&nbsp;<input type="text" name="fahrenheit" disabled>
<input type="button" name="convertBtn" value="Convert" onClick="convert(this.form)">
</form>
<hr>
</center>
</body>
</html>