1
0
Fork 0
mirror of https://github.com/archtechx/money.git synced 2025-12-12 03:14:03 +00:00
This commit is contained in:
Samuel Štancl 2021-11-16 19:15:19 +01:00
parent 8847454577
commit 739f8f8af0

View file

@ -18,8 +18,7 @@ Require the package via composer:
```sh
composer require archtechx/money
```
## Main concepts
# Usage
The package has two main classes:
- `Money` which represents monetary values
@ -27,8 +26,6 @@ The package has two main classes:
This document uses the terms [decimal value](#decimal-value), [base value](#base-value), [default currency](#default-currency), [current currency](#current-currency), [rounding](#rounding), [math decimals](#math-decimals), [display decimals](#display-decimals), and a few others. Refer to the [Terminology](#terminology) section for definitions.
# Usage
## Money
**Important**: As an implementation of the [Money pattern](https://martinfowler.com/eaaCatalog/money.html), the `Money` object creates a new instance after each operation. Meaning, **all `Money` instances are immutable**. To modify the value of a variable, re-initialize it with a new value: