Skip to content

Commit

Permalink
Merge pull request #52 from yuters/yuters-patch-2
Browse files Browse the repository at this point in the history
namespace and methods documentation update
  • Loading branch information
pelmered authored Aug 9, 2024
2 parents bbe74d0 + 2d4c6ee commit 850b5f8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ MONEY_DECIMAL_DIGITS=-4 // Gives 4 significant digits, e.g. $123,400
This can also be set on a per-field basis.

```php
MoneyInput::make('price')->decimalDigits(0);
MoneyEntry::make('price')->decimalDigits(2);
MoneyColumn::make('price')->decimalDigits(-2);
MoneyInput::make('price')->decimals(0);
MoneyEntry::make('price')->decimals(2);
MoneyColumn::make('price')->decimals(-2);
```


Expand All @@ -96,7 +96,7 @@ MoneyColumn::make('price')->decimalDigits(-2);
### Form

```php
use Filament\Forms\Components\MoneyField;
use Pelmered\FilamentMoneyField\Forms\Components\MoneyInput;

MoneyInput::make('price'); // Defaults to USD and the current Laravel locale, or what you have set in your .env/config.

Expand Down Expand Up @@ -208,12 +208,12 @@ MONEY_DECIMAL_DIGITS=-4 // Gives 4 significant digits, e.g. $123,400
This can also be set on a per-field basis.

```php
MoneyInput::make('price')->decimalDigits(0);
MoneyEntry::make('price')->decimalDigits(2);
MoneyColumn::make('price')->decimalDigits(-2);
MoneyInput::make('price')->decimals(0);
MoneyEntry::make('price')->decimals(2);
MoneyColumn::make('price')->decimals(-2);

// You can also pass a callback to the decimalDigits method.
MoneyInput::make('price')->decimalDigits(function () {
// You can also pass a callback to the decimals method.
MoneyInput::make('price')->decimals(function () {
return 0;
});
```
Expand Down

0 comments on commit 850b5f8

Please sign in to comment.