moneybatch / minimalist
Moneybatch Minimalist
Installs: 7
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/moneybatch/minimalist
Requires
- php: ^7.4
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-11-09 20:12:32 UTC
README
Working with one currency? Need easy, affective and stable way to work with Money? Pick the Minimalist.
Installation
composer require moneybatch/minimalist
Usage
-
Make some money:
$money = new Money(100) -
Add more money:
$money->add(new Money(500)) -
Multiply that:
$money->multiplyBy(2) -
Calculate 10%
$money->percent(10)->get() -
Get in Units
$money->inUnits()
All together:
Money::fromSubunits(1000)->add(Money::fromUnits(5))->multiplyBy(2)->percent(10)->get()->inUnits()
will result in 3.0 Units.