1
0
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:
David Sevilla Martin 2020-06-21 19:12:22 -04:00 committed by Franz Liedke
parent 286af7084b
commit dc738d68dc
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -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');