Rename namespace to Tezmanian and prepare for Packagist
PHP Composer / build (push) Successful in 31s
PHP Composer / build (push) Successful in 31s
- Namespace Tez\Utils -> Tezmanian\Utils, package tez/* -> tezmanian/* - Add keywords, homepage, authors and support metadata - Drop VCS repositories (resolved via Packagist) - Remove stale composer.lock, set license holder
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
# tez-utils-num
|
||||
|
||||
[](https://github.com/tezmanian/tez-utils-num/actions/workflows/php.yml)
|
||||
[](https://packagist.org/packages/tezmanian/utils-num)
|
||||
[](https://packagist.org/packages/tezmanian/utils-num)
|
||||
[](LICENSE)
|
||||
|
||||
PHP number utilities: formatting, byte sizes, percentage, clamping, and rounding helpers (`Num`), plus arbitrary-precision decimal arithmetic via bcmath (`Bc`). PHP 8.3+, requires `ext-bcmath`.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
composer require tez/utils-num
|
||||
composer require tezmanian/utils-num
|
||||
```
|
||||
|
||||
Package: [`tezmanian/utils-num`](https://packagist.org/packages/tezmanian/utils-num) · Namespace: `Tezmanian\Utils\Num`
|
||||
|
||||
## Components
|
||||
|
||||
| Class | Purpose |
|
||||
@@ -24,7 +31,7 @@ Formatting and rounding helpers for everyday number display.
|
||||
### format()
|
||||
|
||||
```php
|
||||
use Tez\Utils\Num\Num;
|
||||
use Tezmanian\Utils\Num\Num;
|
||||
|
||||
Num::format(1234567.891); // '1,234,567.89'
|
||||
Num::format(1234567.891, dec: ',', thousands: '.'); // '1.234.567,89'
|
||||
@@ -90,7 +97,7 @@ The default scale is **8 decimal places** for all methods.
|
||||
### Arithmetic
|
||||
|
||||
```php
|
||||
use Tez\Utils\Num\Bc;
|
||||
use Tezmanian\Utils\Num\Bc;
|
||||
|
||||
Bc::add('10.5', '20.3'); // '30.80000000'
|
||||
Bc::sub('20.3', '11.1'); // '9.20000000'
|
||||
@@ -158,8 +165,17 @@ Bc::eq('5.001', '5.009'); // false
|
||||
|
||||
- PHP 8.3+
|
||||
- `ext-bcmath`
|
||||
- `tez/utils-validate` ^1.0
|
||||
- [`tezmanian/utils-validate`](https://packagist.org/packages/tezmanian/utils-validate) ^1.0
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
make build && make install
|
||||
make ci # audit, PHPStan, code style, tests
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
MIT — see [LICENSE](LICENSE).
|
||||
|
||||
Author: René Halberstadt
|
||||
|
||||
Reference in New Issue
Block a user