symfony2的强制数字段在任何语言环境中使用点作为小数分隔符

how to force format to number field in Symfony2 ?

My application is translated to different languages. The problem is that in French I have 1234,56 but it's very important to render field with point 1234.56

I tried that config but it didn't worked:

twig:
    number_format:
        decimals: 2
        decimal_point: '.'
        thousands_separator: ''

Any help will be appreciated.

I had to override number_widget

{%- block number_widget -%}
    {% if value is not empty %}
        {% set value = value|replace({',': '.'})|number_format(precision|default(scale|default(2)), '.', '') %}
    {% endif %}
    {%- set type = type|default('text') -%}
    {{ block('form_widget_simple') }}
{%- endblock number_widget -%}