Skip to content

What is Short Number ​

Short Number is a lightweight, multilingual PHP library for formatting numbers into short, human-readable, compact abbreviations. It can format large numbers into short strings like 1k, 1m, 1b, 1t, 1q, 1qi depending on the language and the number.

Advantages of Short Number ​

Short Number is focused on providing the best performance and the most accurate number formatting. Here are some of the advantages of using Short Number:

🚀 Fast execution
Written to make number parsing as fast as possible

🌍 Multilingual support
Supports multiple languages and can format numbers in different languages

📦 Lightweight
Has no external dependencies and is very lightweight

🪶 Low memory usage
Loads only needed data into memory when parsing the input

📃 Well documented
Has a simple and easy-to-use API with decent docs

Largest Supported Number

Every PHP int is supported, up to PHP_INT_MAX (9,223,372,036,854,775,807) or 9.223 × 10¹⁸.

Supported Languages ​

LanguageCodeThousandMillionBillionTrillionQuadrillionQuintillion
🇬🇧Englishen1k1m1b1t1q1qi
🇷🇺Russianru1тыс1млн1млрд1трлн1квадр1квинт
🇺🇦Ukrainianuk1тис1млн1млрд1трлн1квадр1квинт
🇨🇳Chinesezh1000100万10亿1万亿1000万亿1000000万亿
🇯🇵Japaneseja1000100万10億1兆1000兆100京

Different Counting Systems

Large numbers in languages like Chinese and Japanese are often abbreviated using unique counting systems based on units of 10,000 and 100,000,000. This library accounts for those systems when formatting numbers.