🚀 A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
:lock: Feed input through parseFlot() as means of sanitisation
Marcell Fülöp7d8d3078b262
diff --git a/src/utils/MiscHelpers.js b/src/utils/MiscHelpers.jsindex 14e6c808..11e834bc 100644--- a/src/utils/MiscHelpers.js+++ b/src/utils/MiscHelpers.js@@ -113,7 +113,7 @@ export const formatNumber = (number, decimals = 1) => {const units = ['', 'K', 'M', 'B', 'T'];const k = 1000;const i = Math.floor(Math.log(number) / Math.log(k));- const f = number / (k ** i);+ const f = parseFloat(number / (k ** i));const d = f.toFixed(decimals) % 1.0 === 0 ? 0 : decimals; // number of decimals, omit .0return `${f.toFixed(d)}${units[i]}`;};