]> arthur.barton.de Git - netdata.git/blobdiff - node.d/node_modules/netdata.js
faster zeropad2(); #1281
[netdata.git] / node.d / node_modules / netdata.js
index 6b138ee54fc08199de5c8a1bccfa672504d06183..572e639beee9a69b88fc6f721c86675a62150408 100644 (file)
@@ -134,14 +134,7 @@ var netdata = {
     },
 
     zeropad2: function(s) {
-        if(typeof s !== 'string')
-            s = s.toString();
-
-        switch(s.length) {
-            case 0: return '00';
-            case 1: return '0' + s;
-            default: return s;
-        }
+        return ("00" + s).slice(-2);
     },
 
     logdate: function(d) {