I have a problem at hand due to how numbers are written in my native language German. My Problem is that with German as browser language, the browsers behave differently.
<input matInput="primary" [formControlName]="question.key"
[id]="question.key" [type]="question.type">
I create my forms dynamically.
Now, question.type
is number.
Chrome:
You can put in ,
or .
the form will save it with a .
eg: 11,5 or 11.5 becomes 11.5. The Form also accepts both ,
and .
Firefox:
In Firefox you can't put in .
the type="number"
prevents it. For English browser language its the opposite (as far as I'm aware). You can't put in ,
.
Internet Explorer 11:
IE allows both ,
and .
to be put in, however only the ones with .
will get recognized as number.
I need all of them to work with ,
and .
One extra thing. In my application I want to track these numbers in the URL. Then upon reading those URL params. Which are by default Strings. Number('11,1')
becomes NaN and Number(11,1)
becomes 11