mirror of
https://github.com/flarum/core.git
synced 2025-01-18 06:38:25 +01:00
convert: common/utils/abbreviateNumber
This commit is contained in:
parent
286af7084b
commit
dc738d68dc
@ -4,11 +4,8 @@
|
||||
* @example
|
||||
* abbreviateNumber(1234);
|
||||
* // "1.2K"
|
||||
*
|
||||
* @param {Integer} number
|
||||
* @return {String}
|
||||
*/
|
||||
export default function abbreviateNumber(number) {
|
||||
export default function abbreviateNumber(number: number): string {
|
||||
// TODO: translation
|
||||
if (number >= 1000000) {
|
||||
return Math.floor(number / 1000000) + app.translator.trans('core.lib.number_suffix.mega_text');
|
Loading…
x
Reference in New Issue
Block a user