Closed valichek closed 8 years ago
here is lines of code https://github.com/aurelia/validation/blob/master/src/validation-rules.js#L348-L352:
let numericRegex = locale.setting('numericRegex');
let floatValue = parseFloat(newValue);
return !Number.isNaN(parseFloat(newValue))
&& Number.isFinite(floatValue)
&& numericRegex.test(newValue);
floatValue
will always be NaN if I enter number string like 1,22
We need here some number parser that uses locale settings like https://github.com/jquery/globalize#number-module.
And I think other rules that check numbers like Min, Max, Between, etc will not work with localized strings.
@EisenbergEffect Also it looks like we need some localization module globally in aurelia, Because in aurelia-i18n there is NumberFormatter, but it cannot parse string back to Number.
And all these issues just make impossible using localized validation.
@zewa666 @PWKad Can you two collaborate on this?
Thanks for submitting this / commenting on this. At this time we are closing this because we have completely re-written and are deprecating the previous feature set. If you feel this should be re-opened please feel free to review this blog post and submit either again on this repository, or on the new validatejs bridge repository
Thanks again!
isNumber() rule not working for de-DE locale for decimal numbers like
1,00