From 19eb17bce00b5d86c75d5a5cdebba485527a2fbf Mon Sep 17 00:00:00 2001 From: Jared Ramon Elizan Date: Sat, 16 Jul 2022 10:32:21 +0800 Subject: [PATCH] added answers --- 07_tempConversion/tempConversion.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/07_tempConversion/tempConversion.js b/07_tempConversion/tempConversion.js index 6ef3e85..156ef76 100644 --- a/07_tempConversion/tempConversion.js +++ b/07_tempConversion/tempConversion.js @@ -1,9 +1,13 @@ -const ftoc = function() { - +const ftoc = function(fahr) { + //let converted = parseInt(fahr); + let converted = (fahr - 32) * 5/9; + return Math.round(converted * 10) / 10; }; -const ctof = function() { - +const ctof = function(cel) { + //let converted = parseInt(cel); + let converted = (cel * 9/5) + 32; + return Math.round(converted * 10) / 10; }; // Do not edit below this line