aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/js/nms.js
diff options
context:
space:
mode:
authorNicolai Tellefsen <niccofyren@gmail.com>2016-03-25 01:32:13 +0100
committerNicolai Tellefsen <niccofyren@gmail.com>2016-03-25 01:32:13 +0100
commit1daa378e1eeb92c3e838f80de929707ba8ed7c63 (patch)
tree4936595a15460dd537ba46cc2c106567deca2ee8 /web/nms.gathering.org/js/nms.js
parent60af50c7b3bb7a818e1e25641fae6d0069759665 (diff)
parent7ac4551ed94c1f1393bc69e595a90dbe15bc8f6c (diff)
Merge branch 'master' of ssh://github.com/tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/js/nms.js')
-rw-r--r--web/nms.gathering.org/js/nms.js6
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 c1748bb..99c42cf 100644
--- a/web/nms.gathering.org/js/nms.js
+++ b/web/nms.gathering.org/js/nms.js
@@ -108,14 +108,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];
}
/*