wp_number_format()

Twig function of the framework; its result is escaped like any value.

{{ wp_number_format(number, decimals = 0) }}

A number formatted with the thousands separator and decimal point of the site's language, as returned by number_format_i18n(), as text.

{{ wp_number_format(attrs.price, 2) }}
ParameterTypeDefaultDescription
numberfloatrequiredNumber to format.
decimalsint0Number of decimal places.

Returns string