Twig Extension for Money value object

Update!!
sebastianbergmann/money was abbandonend and the extension was ported to use https://github.com/moneyphp/money instead.


I just released a twig extension for https://github.com/sebastianbergmann/money

The money libary contains a money represention based on the currency’s smallest unit to provide a more accurate handling. See the libary’s readme for more information.

Although the v1.x version of Money brings a Formatter the Twig extension uses its own, which is better suited and more flexible.

What it does? See this:

{{ money|money_i18n_format('de_DE') }} 1.123,45 €
{{ money|money_i18n_format('en_US') }} €1,123.45
{{ money|money_i18n_decimal('en_US') }} 1,123.45
{{ money|money_currency_symbol('en_US') }} €
{{ money|money_currency_name('en_US') }} Euro

Check the readme for more information.

One Reply to “Twig Extension for Money value object”

Comments are closed.