Squiggle Master
Posts: 0
Joined: Thu Feb 06, 2014 6:50 pm

How do you make a farenheit to celsius converter?

I want to make a farenheit to celsius converter for my weather app can anybody help?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do you make a farenheit to celsius converter?

You have to add custom JS with formula to convert fahrenheit to celsius.

Squiggle Master
Posts: 0
Joined: Thu Feb 06, 2014 6:50 pm

How do you make a farenheit to celsius converter?

I'm not exactly sure of the javascript needed and I want to try and link it to a button and an input box.

Squiggle Master
Posts: 0
Joined: Thu Feb 06, 2014 6:50 pm

How do you make a farenheit to celsius converter?

I think this javascript or one of either should be fine but I need help linking it to the input box and button. Please correct it if it is wrong.
function convertToC() {
var fTempVal = parseFloat(document.getElementById('fTemp').value);
var cTempVal = (fTempVal - 32) * (5 / 9);
document.getElementById('cTemp').value = cTempVal;
return false;
}

Code: Select all

 function convertToF() { 
     var cTempVal = parseFloat(document.getElementById('cTemp').value); 
     var fTempVal = (cTempVal * (9 / 5)) + 32; 
     console.log(fTempVal); 
     document.getElementById('fTemp').value = fTempVal; 
     return false; 
 }
Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do you make a farenheit to celsius converter?

Instead predocument.getElementById('cTemp').value/pre use preAppery("componentName").val();/preOn button click add action Run JS and add body of necessary function (not entire function, just function content) to action.

Squiggle Master
Posts: 0
Joined: Thu Feb 06, 2014 6:50 pm

How do you make a farenheit to celsius converter?

I don't get the part about linking the button to the javascript can you help?
I can't see add action.

Return to “Issues”