{# Label #}
{# View #}
{% if schema['units'] == "1" %}
{% if data is not none %} {{ '%g'| format(data.magnitude_in_base_units) | babel_format_number }} {% else %} — {% endif %}
{{ _('Your input is not valid. Please check.') }}
{% else %}
{% if data is not none %} {{ '%g'| format((data | to_datatype).magnitude) | babel_format_number }} {{ (data | to_datatype).units | prettify_units }} {% else %} — {% endif %}
{{ _('Your input is not valid. Please check.') }}
{% endif %}
{# Form #}
{% if schema['units'] == "1" %} {% if id_prefix+'_text' in errors %}{{ errors[id_prefix+'_text'] }} {% endif %} {% else %}
{% if data is not none %} {{ (data | to_datatype).units | prettify_units }}{% else %} {{ schema['units'] | prettify_units }}{% endif %}
{% endif %} {% if id_prefix+'_magnitude' in object_errors %} {{ _('Error:') }} {{ object_errors[id_prefix+'_magnitude'] }}{% endif %} {% if 'note' in schema %} {{ _('Note:') }} {{ schema['note'] | get_translated_text }}{% endif %}