From 20b7a6b062b8f385e22e6e4c99b1da59fbefed12 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 13 Feb 2022 15:14:11 +0000 Subject: [PATCH] :necktie: Adds function to convery farenheight to celcius --- src/utils/MiscHelpers.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/MiscHelpers.js b/src/utils/MiscHelpers.js index fd34ada9..cc26403e 100644 --- a/src/utils/MiscHelpers.js +++ b/src/utils/MiscHelpers.js @@ -145,6 +145,11 @@ export const getValueFromCss = (colorVar) => { return cssProps.getPropertyValue(`--${colorVar}`).trim(); }; +/* Given a temperature in Fahrenheit, returns value in Celsius */ +export const fahrenheitToCelsius = (fahrenheit) => { + return Math.round(((fahrenheit - 32) * 5) / 9); +}; + /* Given a currency code, return the corresponding unicode symbol */ export const findCurrencySymbol = (currencyCode) => { const code = currencyCode.toUpperCase().trim();