Returns an abbreviated form of the given number containing as few decimal values as possible and, if necessary, an alphabetical suffix.
The number to return the abbreviation for.
Should only be used for special cases. In most cases Intl.NumberFormat with notation: "compact" will work better.
Intl.NumberFormat
notation: "compact"
abbreviateNumber(1234);// => "1.23K"abbreviateNumber(12345678);// => "12.3M"abbreviateNumber(123456789101);// => "123B"abbreviateNumber(12345678910111);// => "12.3T" Copy
abbreviateNumber(1234);// => "1.23K"abbreviateNumber(12345678);// => "12.3M"abbreviateNumber(123456789101);// => "123B"abbreviateNumber(12345678910111);// => "12.3T"
Returns an abbreviated form of the given number containing as few decimal values as possible and, if necessary, an alphabetical suffix.