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();