👔 Adds function to convery farenheight to celcius

This commit is contained in:
Alicia Sykes 2022-02-13 15:14:11 +00:00
parent c1607cb19b
commit 20b7a6b062

View File

@ -145,6 +145,11 @@ export const getValueFromCss = (colorVar) => {
return cssProps.getPropertyValue(`--${colorVar}`).trim(); 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 */ /* Given a currency code, return the corresponding unicode symbol */
export const findCurrencySymbol = (currencyCode) => { export const findCurrencySymbol = (currencyCode) => {
const code = currencyCode.toUpperCase().trim(); const code = currencyCode.toUpperCase().trim();