# How to manage custom formatting and validation for numeric form fields

**URL:** <https://discuss.workflowgen.com/t/how-to-manage-custom-formatting-and-validation-for-numeric-form-fields/845>\
**Category:** Process Design\
**Created:** [August 15, 2017, 9:12pm UTC](https://discuss.workflowgen.com/t/how-to-manage-custom-formatting-and-validation-for-numeric-form-fields/845 "2017-08-15T21:12:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddy.daouk](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/eddy.daouk/32/672_2.png) [@eddy.daouk](https://discuss.workflowgen.com/u/eddy.daouk)\
**Post date:** [August 15, 2017, 9:12pm UTC](https://discuss.workflowgen.com/t/how-to-manage-custom-formatting-and-validation-for-numeric-form-fields/845/1 "2017-08-15T21:12:20Z")

</div>

If you’re using WorkflowGen’s default ASP.NET `RangeValidator` control to validate numeric values that contain thousand separators (for example, `123,456.78` in the `en-US` language/culture, or `123 456,78` in the `fr-FR` language/culture), you’ll need to perform this workaround, which must be done for each numeric form field.

Steps 1 and 2 will format and display the default values in the form fields according to the current user’s language/culture setting. Steps 3 and 4 will prevent the default numeric `RangeValidator` control from validating the field value by adding a custom regex validator. Step 5 is optional, and will automatically format the input value based on the language/culture.

This example uses the format for the `fr-FR` language/culture.

1. Set the field format to `Numeric`. This sets a `fielddatatype` attribute with the `Numeric` value at the field level.

2. Add another custom attribute field format with the value `{0:N2}`, so that the formatted value will use a space as the thousand separator and a comma as the decimal separator (for example, `123 456,78`).

3. Add a regex validation at the field level to validate numeric values in the `123 456,78` format:

4. In the .NET editor, add the following code to disable the default numeric `RangeValidator` for the specific fields.

5. **Optional:** To automatically format the input value to `fr-FR`, add a custom `onchange` attribute with the following JavaScript code as the value:

---

<div class="post-metadata">

**Author:** ![pnicoll](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/pnicoll/32/454_2.png) [@pnicoll](https://discuss.workflowgen.com/u/pnicoll)\
**Post date:** [August 17, 2017, 2:42pm UTC](https://discuss.workflowgen.com/t/how-to-manage-custom-formatting-and-validation-for-numeric-form-fields/845/2 "2017-08-17T14:42:55Z")

</div>



---

<div class="post-metadata">

**Author:** ![pnicoll](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/pnicoll/32/454_2.png) [@pnicoll](https://discuss.workflowgen.com/u/pnicoll)\
**Post date:** [August 17, 2017, 3:38pm UTC](https://discuss.workflowgen.com/t/how-to-manage-custom-formatting-and-validation-for-numeric-form-fields/845/3 "2017-08-17T15:38:40Z")

</div>


