This is a Kelvin converter. Enter any temperature in Kelvin to find out what it would be in Fahrenheit and Newton.
Behind the scenes
Converting the different measurements of temperature can be tedious in person, so I decided to include this in my website as it is an easy formula and this can be done very quickly by computer. It also removes the step of looking up the equation ratio.
The code
HTML
<p>This is a Kelvin converter. Enter any temperature in Kelvin to find out what it would be in Fahrenheit and Newton.
</p><form><input type="number" id="kelvintemp">
<button type="button" onclick="kelvinconvert()">Convert</button>
</form>
<p id="fahrenheitresult">
</p><p id="newtonresult"></p>
Javascript
<script type="text/javascript">
function kelvinconvert() {
var kelvin=document.getElementById('kelvintemp').value;
//degrees kelvin
const celsius=kelvin-273
//degrees fahrenheit
let fahrenheit = celsius * (9 / 5) + 32;
//fahrenheit intiger
fahrenheit=Math.floor(fahrenheit)
// Convert to Newton
let newton = celsius * (33 / 100);
// Round down
newton = Math.floor(newton);
document.getElementById("fahrenheitresult").innerHTML=`The temperature is ${fahrenheit} degrees Fahrenheit.`;
document.getElementById("newtonresult").innerHTML=`The temperature is ${newton} degrees Newton.`;
return;
}
</script>