diff options
Diffstat (limited to 'dashboard/assets/components/CustomTooltip.jsx')
-rw-r--r-- | dashboard/assets/components/CustomTooltip.jsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dashboard/assets/components/CustomTooltip.jsx b/dashboard/assets/components/CustomTooltip.jsx index be7c624cf..3405f9305 100644 --- a/dashboard/assets/components/CustomTooltip.jsx +++ b/dashboard/assets/components/CustomTooltip.jsx @@ -38,15 +38,15 @@ export const percentPlotter = <T>(text: string, mapper: (T => T) = multiplier(1) }; // unit contains the units for the bytePlotter. -const unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; +const unit = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi']; // simplifyBytes returns the simplified version of the given value followed by the unit. const simplifyBytes = (x: number) => { let i = 0; - for (; x > 1024 && i < 5; i++) { + for (; x > 1024 && i < 8; i++) { x /= 1024; } - return x.toFixed(2).toString().concat(' ', unit[i]); + return x.toFixed(2).toString().concat(' ', unit[i], 'B'); }; // bytePlotter renders a tooltip, which displays the payload as a byte value. |