mirror of
https://github.com/archtechx/money.git
synced 2025-12-12 11:24:03 +00:00
Correct decimal method name
This commit is contained in:
parent
fd2fa86cf0
commit
eb9b9a2141
1 changed files with 7 additions and 7 deletions
14
README.md
14
README.md
|
|
@ -138,7 +138,7 @@ $money->value(); // 1200
|
||||||
```php
|
```php
|
||||||
$money = Money::fromDecimal(100.0, new USD);
|
$money = Money::fromDecimal(100.0, new USD);
|
||||||
$money->value(); // 10000
|
$money->value(); // 10000
|
||||||
$money->decimals(); // 100.0
|
$money->decimal(); // 100.0
|
||||||
```
|
```
|
||||||
|
|
||||||
### Formatting money
|
### Formatting money
|
||||||
|
|
@ -216,12 +216,12 @@ This rounding (to full crowns) is standard and legal per the accounting legislat
|
||||||
For that use case, our package lets you get the rounding difference using a simple method call:
|
For that use case, our package lets you get the rounding difference using a simple method call:
|
||||||
```php
|
```php
|
||||||
$money = Money::fromDecimal(9.90, CZK::class);
|
$money = Money::fromDecimal(9.90, CZK::class);
|
||||||
$money->decimals(); // 9.90
|
$money->decimal(); // 9.90
|
||||||
$money->formatted(); // 10 Kč
|
$money->formatted(); // 10 Kč
|
||||||
$money->rounding(); // +0.10 Kč = 10
|
$money->rounding(); // +0.10 Kč = 10
|
||||||
|
|
||||||
$money = Money::fromDecimal(3.30, CZK::class);
|
$money = Money::fromDecimal(3.30, CZK::class);
|
||||||
$money->decimals(); // 3.30
|
$money->decimal(); // 3.30
|
||||||
$money->formatted(); // 3 Kč
|
$money->formatted(); // 3 Kč
|
||||||
$money->rounding(); // -0.30 Kč = -30
|
$money->rounding(); // -0.30 Kč = -30
|
||||||
```
|
```
|
||||||
|
|
@ -231,15 +231,15 @@ $money->rounding(); // -0.30 Kč = -30
|
||||||
```php
|
```php
|
||||||
// Using the currency rounding
|
// Using the currency rounding
|
||||||
$money = Money::fromDecimal(9.90, CZK::class);
|
$money = Money::fromDecimal(9.90, CZK::class);
|
||||||
$money->decimals(); // 9.90
|
$money->decimal(); // 9.90
|
||||||
$money = $money->rounded(); // currency rounding
|
$money = $money->rounded(); // currency rounding
|
||||||
$money->decimals(); // 10.0
|
$money->decimal(); // 10.0
|
||||||
|
|
||||||
// Using custom rounding
|
// Using custom rounding
|
||||||
$money = Money::fromDecimal(2.22, USD::class);
|
$money = Money::fromDecimal(2.22, USD::class);
|
||||||
$money->decimals(); // 2.22
|
$money->decimal(); // 2.22
|
||||||
$money = $money->rounded(1); // custom rounding: 1 decimal
|
$money = $money->rounded(1); // custom rounding: 1 decimal
|
||||||
$money->decimals(); // 2.20
|
$money->decimal(); // 2.20
|
||||||
```
|
```
|
||||||
|
|
||||||
## Currencies
|
## Currencies
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue