Making number_format respecting locale?

I’ve installed the necessary locale onto my webserver, restarted Apache and override_locale is set to true but none of this seems to do anything.

Is there a way to have Twig format numbers based on locale?

Are the digits in your locale different to 0…9? I’ll assume not and it’s simply the formatting.

Have you seen the Twig filter number_format? You can also set the default format using that snippet of PHP, which is probably easiest to place in your theme’s PHP file. If this filter works and you want help setting a default format with PHP, let me know.

Also note that I don’t know exactly what override_locale does, so you may have used that incorrectly for all I know. I am pretty sure it won’t make Twig automatically format numbers though. Twig probably treats all numbers dumbly as strings unless you are doing some arithmetic on them, regardless of locale settings.