From 7ac4551ed94c1f1393bc69e595a90dbe15bc8f6c Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Thu, 24 Mar 2016 21:15:50 +0100 Subject: NMS: Update public api --- web/nms-public.gathering.org/js/nms.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web/nms-public.gathering.org/js/nms.js') diff --git a/web/nms-public.gathering.org/js/nms.js b/web/nms-public.gathering.org/js/nms.js index c09fca0..8783844 100644 --- a/web/nms-public.gathering.org/js/nms.js +++ b/web/nms-public.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]; } /* -- cgit v1.2.3