{% set roundMode = roundMode|default('') %}
{% set scale = scale|default('') %}
{% set options = {
    'mautic.lead.field.form.number.roundup': constant('NumberFormatter::ROUND_UP'),
    'mautic.lead.field.form.number.rounddown': constant('NumberFormatter::ROUND_DOWN'),
    'mautic.lead.field.form.number.roundhalfup': constant('NumberFormatter::ROUND_HALFUP'),
    'mautic.lead.field.form.number.roundhalfeven': constant('NumberFormatter::ROUND_HALFEVEN'),
    'mautic.lead.field.form.number.roundhalfdown': constant('NumberFormatter::ROUND_HALFDOWN'),
} %}
<div class="number">
    <div class="row">
        <div class="form-group col-xs-12 col-sm-8 col-md-6">
            <label class="control-label">{{ 'mautic.lead.field.form.properties.numberrounding'|trans }}</label>
            <div class="input-group">
                <select class="form-control not-chosen" autocomplete="false" name="leadfield[properties][roundmode]">
                  {% for l, v in options %}
                    <option value="{{ v|e }}" {% if roundMode == v %}selected="selected"{% endif %}>{{ l|trans }}</option>
                  {% endfor %}
                </select>
                <span class="input-group-addon" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="{{ 'mautic.lead.field.help.numberrounding'|trans }}">
                    <i class="ri-question-line"></i>
                </span>
            </div>
        </div>
        <div class="form-group col-xs-12 col-sm-8 col-md-6">
            <label class="control-label">{{ 'mautic.lead.field.form.properties.numberprecision'|trans }}</label>
            <div class="input-group">
                <input autocomplete="false" name="leadfield[properties][scale]" class="form-control" value="{{ scale|purify }}" type="number" />
                <span class="input-group-addon" data-toggle="tooltip" data-container="body"
                      data-placement="top" data-original-title="{{ 'mautic.lead.field.help.numberprecision'|trans }}">
                    <i class="ri-question-line"></i>
                </span>
            </div>
        </div>
    </div>
</div>
