🔧Abbreviate

Members

getFirstDigitsAsDecimal

This method takes a large number like "9360" and converts it to a small decimal like "9.3". Used by abbreviateNumber() to form abbreviations such as "9.3K". For the moment, this method intentionally avoids rounding numbers for simplicity.

Functions

abbreviateNumber()

The abbreviation follows the format seen in many games: K - thousands M - millions B - billons T - trillons

All numbers greater than billions follow the following format, using each letter of the alphabet paired with itself: AA BB ... ZZ

It supports all numbers up to almost a googol (100 zeros) and supports up to 92 zeros or 93 digits.

getFirstDigitsAsDecimal

This method takes a large number like "9360" and converts it to a small decimal like "9.3". Used by abbreviateNumber() to form abbreviations such as "9.3K". For the moment, this method intentionally avoids rounding numbers for simplicity.

Kind: global variable

abbreviateNumber()

The abbreviation follows the format seen in many games: K - thousands M - millions B - billons T - trillons

All numbers greater than billions follow the following format, using each letter of the alphabet paired with itself: AA BB ... ZZ

It supports all numbers up to almost a googol (100 zeros) and supports up to 92 zeros or 93 digits.

Kind: global function

Last updated