1
0
Fork 0
mirror of https://github.com/archtechx/money.git synced 2025-12-12 03:14:03 +00:00

Apply text suggestions from code review

Co-authored-by: Samuel Štancl <samuel@archte.ch>
This commit is contained in:
Gaurav Makhecha 2022-03-15 16:46:08 +05:30 committed by GitHub
parent a8d32a0be8
commit 96786939bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -166,13 +166,13 @@ $money = Money::fromDecimal(40.25, USD::class);
$money->formatted(['decimalSeparator' => ',', 'prefix' => '$ ', 'suffix' => ' USD']); $money->formatted(['decimalSeparator' => ',', 'prefix' => '$ ', 'suffix' => ' USD']);
``` ```
There is also a `->rawFormatted()` if you wish to use [math decimals](#math-decimals) instead of [display decimals](#display-decimals). There's also `->rawFormatted()` if you wish to use [math decimals](#math-decimals) instead of [display decimals](#display-decimals).
```php ```php
$money = Money::new(123456, CZK::class); $money = Money::new(123456, CZK::class);
$money->rawFormatted(); // 1 235,56 Kč $money->rawFormatted(); // 1 234,56 Kč
``` ```
And converting the formatted value back to the Money instance is also possible. The package tries to extract the currency from the provided string. Converting the formatted value back to the `Money` instance is also possible. The package tries to extract the currency from the provided string:
```php ```php
$money = money(1000); $money = money(1000);
$formatted = $money->formatted(); // $10.00 $formatted = $money->formatted(); // $10.00