PHPackages                             4slovo/money - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. 4slovo/money

ActiveLibrary

4slovo/money
============

money helper

v1.0.4(7y ago)08531MITPHP

Since Apr 27Pushed 7y agoCompare

[ Source](https://github.com/4slv/money)[ Packagist](https://packagist.org/packages/4slovo/money)[ RSS](/packages/4slovo-money/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (1)

Money
=====

[](#money)

Класс Money должен использоваться для денежных рассчётов. Деньги должны задаваться в минорных денежных единицах (копейках, центах, пенни и.т.д)

Доступные операции:
-------------------

[](#доступные-операции)

**create** - **создание**

```
$money = Money::create(100);
```

**getAmount** - **получение суммы в минорных единицах**

```
$result = Money::create(100)->getAmount(); // $result = 100
$result = Money::create(100.99)->getAmount(); // $result = 100
```

### Сравнение

[](#сравнение)

**equal** - сравнение **равно**

```
$result = Money::create(100)->equal(Money::create(100)); // $result = true
```

**equalOrLess** - сравнение **меньше или равно**

```
$result = Money::create(100)->equalOrLess(Money::create(1000)); // $result = true
$result = Money::create(100)->equalOrLess(Money::create(100)); // $result = true
$result = Money::create(1000)->equalOrLess(Money::create(100)); // $result = false
```

**equalOrMore** - сравнение **больше или равно**

```
$result = Money::create(100)->equalOrMore(Money::create(1000)); // $result = flase
$result = Money::create(100)->equalOrMore(Money::create(100)); // $result = true
$result = Money::create(1000)->equalOrMore(Money::create(100)); // $result = true
```

**less** - сравнение **меньше**

```
$result = Money::create(100)->less(Money::create(1000)); // $result = true
$result = Money::create(100)->less(Money::create(100)); // $result = false
$result = Money::create(1000)->less(Money::create(100)); // $result = false
```

**more** - сравнение **больше**

```
$result = Money::create(100)->more(Money::create(1000)); // $result = false
$result = Money::create(100)->more(Money::create(100)); // $result = false
$result = Money::create(1000)->more(Money::create(100)); // $result = true
```

### Математические операции

[](#математические-операции)

**add** - операция **сложение**

```
$result = Money::create(100)->add(Money::create(100)); // $result = Money::create(200)
```

**addList** - операция **сложение списка**

```
$result = Money::create(100)->addList([
    Money::create(100),
    Money::create(100)
]); // $result = Money::create(300)
```

**sub** - операция **вычитание**

```
$result = Money::create(300)->sub(Money::create(100)); // $result = Money::create(200)
```

**subList** - операция **вычитание списка**

```
$result = Money::create(500)->subList([
    Money::create(100),
    Money::create(100)
]); // $result = Money::create(300)
```

**round** - операция **округление**

```
$result = Money::create()->round(1000/3); // $result = 333
```

**mul** - операция **умножение**

```
$result = Money::create(1000)->mul(1/3); // $result = Money::create(333)
```

**dev** - операция **деление**

```
$result = Money::create(1000)->div(3); // $result = Money::create(333)
```

### Разбиение на части

[](#разбиение-на-части)

**allocate** - операция **разбиение на части**

```
$result = Money::create(3500000)->allocate(3); // $result = [Money::create(1166700), Money::create(1166700), Money::create(1166600)]
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Total

4

Last Release

2585d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/690ec49c290d430acec8fe69ad6e9785419d2426a71d1b1172d9d9b6cc9f70f0?d=identicon)[4slv](/maintainers/4slv)

---

Top Contributors

[![4slv](https://avatars.githubusercontent.com/u/34535446?v=4)](https://github.com/4slv "4slv (10 commits)")[![x5hell](https://avatars.githubusercontent.com/u/5240238?v=4)](https://github.com/x5hell "x5hell (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/4slovo-money/health.svg)

```
[![Health](https://phpackages.com/badges/4slovo-money/health.svg)](https://phpackages.com/packages/4slovo-money)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
