Skip to content

Commit

Permalink
Update MoneyField.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris53897 authored Jul 6, 2024
1 parent 35953b5 commit 4e56b05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/fields/MoneyField.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,15 @@ storing money amounts using float or decimal numbers.
In Symfony/PHP applications you can use the `Money PHP`_ library to handle
the conversion of money amounts from/into cents.

If you follow this practice, use this option to tell EasyAdmin to convert from/into
If you follow this practice (this is set by default), use this option to tell EasyAdmin to convert from/into
cents automatically when displaying and storing money amounts::

yield MoneyField::new('...')->setStoredAsCents();

If you do not store this in cents, you have to explicit define this.

yield MoneyField::new('...')->setStoredAsCents(false);

.. note::

When this option is enabled, the ``divisor`` is set at ``100`` automatically.
Expand Down

0 comments on commit 4e56b05

Please sign in to comment.