bariscodefx/php-number-format-kmt
最新稳定版本:v1.0.0
Composer 安装命令:
composer require bariscodefx/php-number-format-kmt
包简介
Format numbers as K, M, and T. (example: 300000 -> 300k)
README 文档
README
What is this?
This is a very very simple number format library for formatting numbers like; 320.000.000 -> 320M, 12.000 -> 12K, 1.300.000.000 -> 1.3T.
Why I did that?
I don't like PHP's number/currency formatting. It's only formats with dots (.) and commas (,). Most games use (K, M, T) letters for number formatting. And I think that's better.
How to install?
composer require bariscodefx/php-number-format-kmt
Usage
<?php use PHPNumberFormatKMT\NumberFormatKMT; echo NumberFormatKMT::format(1000); // 1 K echo NumberFormatKMT::format(1000, discriminator: ''); // 1K echo NumberFormatKMT::format(1111); // 1.1 K echo NumberFormatKMT::format(1111, precision: 2); // 1.11 K
Support
If you like this project, you can contribute to me by starring it.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2024-08-24