tempConversion.js

This commit is contained in:
Carlos Leon, Jr 2019-10-21 17:35:44 -07:00
parent b0400f7f33
commit e3f8c6dcb1
1 changed files with 20 additions and 2 deletions

View File

@ -1,10 +1,28 @@
const ftoc = function() {
const ftoc = function(fDegrees) {
fTemp = (fDegrees - 32) * (5 / 9);
var fhTemp = fTemp.toFixed(1);
return (Math.round(fhTemp * 10) / 10);
}
ftoc(32);
ftoc(100);
ftoc(-100);
const ctof = function() {
const ctof = function(cDegrees) {
cTemp = (cDegrees * (9/5) + 32);
var clTemp = cTemp.toFixed(1);
return Math.round(clTemp * 10) / 10;
}
ctof(0);
ctof(73.2);
ctof(-10);
module.exports = {
ftoc,