mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Implement power of two size suffies for memory
Memory sizes are usually written using the prefixes with a base of 1024 instead of 1000. Implment formatting of the power of two based prefixes for displaying memory sizes.
This commit is contained in:
1 parent
d64bf6015e
commit
ae2c5cf98e
3 files changed
+60
-7
No files matched your search
@@ -32,8 +32,8 @@ export function MetricMemoryUsed(props: { metrics?: lib.SystemMetrics }) {
|
||||
if (!props.metrics) {
|
||||
return "N/A";
|
||||
}
|
||||
const used = lib.formatBytes(props.metrics.memoryUsed);
|
||||
const capacity = lib.formatBytes(props.metrics.memoryCapacity);
|
||||
const used = lib.formatBytes(props.metrics.memoryUsed, "binary");
|
||||
const capacity = lib.formatBytes(props.metrics.memoryCapacity, "binary");
|
||||
return `${used} / ${capacity}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user