C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Convert Celsius from/to Fahrenheit


Posted Date: 23 Jun 2008    Resource Type: Code Snippets    Category: Javascript
Author: Kapil DhawanMember Level: Gold    
Rating: Points: 4



The sample code below is a Javascript function that converts Celsius to Farenheit and vice versa. It is a simple mathematical conversion


<script type="text/javascript">
function convert(Totalvalue,Type)
{
if (Type=="C")
{
var Cel=Totalvalue* 9 / 5 + 32;
document.write(Cel);
}
else
{
var Far=(Totalvalue-32) * 5 / 9;
document.write(Far);
}
}
</script>



The following HTML tag is an example of how to put the above code to use.


<body onload="convert(102,'F')">
</body>





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Farenheit to Celsius  .  Convert Farenheit to Celsius  .  Convert Celsius to Farenheit  .  Celsius to Farenheit  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Handling MouseOver and MouseOut events with JavaScript
Previous Resource: Display Running Time of a Page using JavaScript
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use