mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
fixed human readable view post counts
This commit is contained in:
@@ -207,14 +207,17 @@
|
||||
},
|
||||
|
||||
makeNumberHumanReadable: function(num) {
|
||||
num = parseInt(num, 10);
|
||||
if (num > 999999) {
|
||||
return (num / 1000000).toFixed(1) + 'm';
|
||||
var n = parseInt(num, 10);
|
||||
if(!n) {
|
||||
return num;
|
||||
}
|
||||
else if(num > 999) {
|
||||
return (num / 1000).toFixed(1) + 'k';
|
||||
if (n > 999999) {
|
||||
return (n / 1000000).toFixed(1) + 'm';
|
||||
}
|
||||
return num;
|
||||
else if(n > 999) {
|
||||
return (n / 1000).toFixed(1) + 'k';
|
||||
}
|
||||
return n;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user