$(document).on('pageshow','#temperatureContents',function(){
$(document).off('click','#convertbtnTemp').on('click','#convertbtnTemp',function(){
textFieldValue = $('#numberField').val();
});
});
if(selectFrom == "celcius" && selectTo == "kelvin"){
celToKel(selectFrom,selectTo,textFieldValue);
}
function celToKel(selectFrom,selectTo,textFieldValue){
var value = Number(textFieldValue).toFixed(1);
var result = (value + 273.15);
displayResult(selectFrom,selectTo,result);
}
function displayResult(selectFrom,selectTo,result){
$('#resultDiv').show();
$('#resultDisplay').empty().append("the Result of " + selectFrom + " to " + selectTo + " is: " + result);
}
問題は、これらの 2 行で1 + 273.15 = 1.0273.15 が得られることですが、273.15 に 1 を追加したいのですが、どうすればこれを取得できますか?
var value = Number(textFieldValue).toFixed(1);
var result = (value + 273.15);