Actionscript functions with parameters

function celToFar(cel:Number):Number {
return (9/5)*cel + 32;
}
trace(celToFar(20));
//68
function farToCel(far:Number):Number {
return (5/9)*(far - 32);
}
var celDeg:Number = farToCel(68));
trace(celDeg);
//20

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.