serhii/short-number

For changing the language you want to call `set` method once before calling other methods from this package.

4.2.0 2025-06-18 11:44 UTC

This package is auto-updated.

Last update: 2025-06-19 17:16:30 UTC


README

Short number Total Downloads License

Lightweight package shortens given number to a short representation of it. For example 1234 will be formatted to 1k and 20244023 to 20m. Package supports multiple languages and can be easily extended with new languages.

Follow the full documentation for this package

Quick Start

composer require serhii/short-number

Supported Languages

Flag Language Code
πŸ‡¬πŸ‡§ English en
πŸ‡·πŸ‡Ί Russian ru
πŸ‡ΊπŸ‡¦ Ukrainian uk
πŸ‡¨πŸ‡³ Chinese zh
πŸ‡―πŸ‡΅ Japanese ja

License

The Short Number project is licensed under the MIT License

Development

Without Docker

You'll need to have Composer and PHP installed on your machine

With Docker

Build an image

To build an image, navigate to the root of the project that contains Dockerfile and run this command:

docker compose build app

Run the container

To run a container, navigate to the root of the project that contains Dockerfile and run this command:

docker compose run --rm app