Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

input[number] automatic recognition of localized decimal character not consistent across browsers #10146

@zzal

Description

@zzal

You can try it from the official API docs: https://docs.angularjs.org/api/ng/input/input[number]

I don't know if this is a bug or a lack of parameters adjustments, but I post it anyway.

When you're in a non-english localized browser (in which the decimal mark is the comma, like in French, German, Finnish, etc), if you enter a valid number (say 12,5 or 12.5), the Angular input[number] directive recognize it like a valid number.
But as soon as you use an english-only browser, there is no way Angular can treat the same input as valid. If you enter 12,5 in the same input field, it considers it as invalid.
I think this is not consistent, and there should be a way to tell the directive what characters are considered as the decimal separator. Or maybe there is a way to set this but it is not documented.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions