mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 07:33:36 +08:00
10 lines
226 B
JavaScript
10 lines
226 B
JavaScript
export default function(number) {
|
|
if (number >= 1000000) {
|
|
return Math.floor(number / 1000000)+'M';
|
|
} else if (number >= 1000) {
|
|
return Math.floor(number / 1000)+'K';
|
|
} else {
|
|
return number.toString();
|
|
}
|
|
}
|