Knockout-Contrib / Knockout-Contrib/Knockout-Validation
number validation is not taking localization into account.
Open
Nobody has claimed this yet.
todo
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 366
- PR merge metrics
- No merged PRs in 30d
Description
This is my current workaround.
ko.validation.rules['localizedNumber'] = {
validator: function (val, validate) {
if (validate)
return !isNaN(Globalize.parseFloat(val.toString()));
else return !validate;
},
message: 'Please enter a number'
};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the number validation rule and the ko.validation.rules entry described in the issue, then compare its parsing behavior with the Globalize.parseFloat workaround. Done means localized numeric input is accepted or rejected correctly by the standard validation behavior; the issue does not name a file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100