Skip to content
Twig Field Finder
Theme

Number (decimal / float) — formatted

Fill in your field name

Italic values are placeholders: replace them with your own machine names, or let the builder do it.

Reads the entity directly, before field formatters run.

  1. Twig
    {{ node.field_name.value|number_format(2, ',', '.') }}

Reads the content render array, after field formatters run.

  1. Twig
    {{ content.field_name }}

Gotcha

The render array uses the formatter’s thousand and decimal separators; number_format takes decimals, decimal point and thousands separator.