Brick/Money is a money and currency library for PHP that handles exact calculations on monies of any size. So we can use this library that is based on brick/math and handles exact calculations on monies of any size. This library is installable via Composer: composer require brick/money

To create Money, call the of() factory method: use Brick\Money\Money; $money = Money::of(50, 'USD'); // USD 50.00 $money = Money::of('19.9', 'USD'); // USD 19.90 Alternatively, you can create Money from a number of "minor units"(cents), using the ofMinor() method: use Brick\Money\Money; $money = Money::ofMinor(1234, 'USD'); // USD 12.34
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners