Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:necktie: Adds function to convery farenheight to celcius

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