footer stats will display human readable stuff

This commit is contained in:
Baris Usakli
2013-10-16 13:25:17 -04:00
parent 33bda6fd16
commit a0c7e187f5
2 changed files with 15 additions and 3 deletions

View File

@@ -162,6 +162,15 @@
isRelativeUrl: function(url) {
var firstChar = url.slice(0, 1);
return (firstChar === '.' || firstChar === '/');
},
makeNumberHumanReadable: function(num) {
num = parseInt(num, 10);
if (num > 999999)
return (num / 1000000).toFixed(1) + 'm';
else if(num > 999)
return (num / 1000).toFixed(1) + 'k';
return num;
}
}