JavaScript - Quiero hacer un conversor de temperatura con javascript y no se

 
Vista:

Quiero hacer un conversor de temperatura con javascript y no se

Publicado por Pablo (1 intervención) el 11/03/2013 17:21:56
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var calcula = function (action) {
if (action === "") { //borra caja texto
document.getElementById("txt1").value="";
}
else if (action === "=") { //hacer cálculos
var kelvintofarenheit = function (k) {
if(isNaN(k) || k<0) {
alert("kelvin debe ser un número mayor o igual a cero")
k=0;
document.getElementById("txt").value=k;
}
var f = (k-273)*1.8+32;
return f.toFixed(3)
};
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder