/*-------------------------------------------
  Temperature Converter
  C0D3D by Gunnar Leffler
  http://www.leftech.com
  Version 1.0
  You are looking at my code. Shame on you! :)
  --------------------------------------------*/



function getRND ()
{

 var max1 = arguments[0];
 var retval = Math.floor (Math.random() * max1);
 return retval;
}


function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}

function c_to_f (t) 
{
 return roundNumber(t*1.8+32,2);
}

function f_to_c (t) 
{
 return roundNumber((t-32)/1.8,2);
}


/*------------------------------------------------------
  These functions are for the general fatburn calculator
  ------------------------------------------------------*/

function calculate ()
{

 var tmp = document.getElementById("temp").value;


 var retval = tmp+"°C is  <b>"+c_to_f(tmp)+"°F</b><br><br>"+tmp+"°F is  <b>"+f_to_c(tmp)+"°C</b>";
 document.getElementById ("results").innerHTML  = retval; 

}  
