Tighten regex for floats

You're no longer allowed to type multiple radices, for instance.

Contributes to issue CURA-3157.
This commit is contained in:
Ghostkeeper 2016-12-16 15:28:38 +01:00
parent c4e061be60
commit 0c212d01b9
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -100,7 +100,7 @@ SettingItem
maximumLength: 10;
validator: RegExpValidator { regExp: (definition.type == "int") ? /^-?[0-9]{0,10}/ : /^-?[0-9.,]{0,10}/ } // definition.type property from parent loader used to disallow fractional number entry
validator: RegExpValidator { regExp: (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[0-9]?[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry
Binding
{