diff options
author | Kristian Lyngstol <kly@kly@.no> | 2016-03-24 17:46:54 +0100 |
---|---|---|
committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-24 17:46:54 +0100 |
commit | 5ed1a58290c97371ba4e7de40f3a467c3d0b6ebe (patch) | |
tree | 96c156a7690940dc9c28bc6dc4551ae6317aa984 /web/nms.gathering.org/js/nms.js | |
parent | eec36f7d4259bf0dd049e478c99f1c5e834b13a7 (diff) |
NMS: Tweak uplink traffic map
Diffstat (limited to 'web/nms.gathering.org/js/nms.js')
-rw-r--r-- | web/nms.gathering.org/js/nms.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/web/nms.gathering.org/js/nms.js b/web/nms.gathering.org/js/nms.js index 1c750b8..ea440fc 100644 --- a/web/nms.gathering.org/js/nms.js +++ b/web/nms.gathering.org/js/nms.js @@ -100,14 +100,16 @@ function nmsTimer(handler, interval, name, description) { * Convenience function that doesn't support huge numbers, and it's easier * to comment than to fix. But not really, but I'm not fixing it anyway. */ -function byteCount(bytes) { +function byteCount(bytes,precision) { + if (precision ==undefined) + precision = 1; var units = ['', 'K', 'M', 'G', 'T', 'P']; var i = 0; while (bytes > 1024) { bytes = bytes / 1024; i++; } - return bytes.toFixed(1) + units[i]; + return bytes.toFixed(precision) + units[i]; } /* |