From 6367e15236b42b84bea7011dc7b0aa53703aeb47 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Sun, 19 Jul 2020 11:40:11 +0200 Subject: [PATCH] add TB and EB to data volume function --- res/include/script/dependencies/util.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/res/include/script/dependencies/util.js b/res/include/script/dependencies/util.js index 08384b4..c03e824 100644 --- a/res/include/script/dependencies/util.js +++ b/res/include/script/dependencies/util.js @@ -73,7 +73,11 @@ function formatThousands(x) { function formatDataVolume(amt, precision) { if (precision < 3) { precision = 3; } - if (amt >= 1e12) { + if (amt >= 1e18) { + return (amt/1e18).toPrecision(precision) + " EB"; + }else if (amt >= 1e15) { + return (amt/1e15).toPrecision(precision) + " PB"; + }else if (amt >= 1e12) { return (amt/1e12).toPrecision(precision) + " TB"; } else if (amt >= 1e9) { return (amt/1e9).toPrecision(precision) + " GB";