0

My question is for input tags and when the type is a number Say I had a number

French

<input type="number" value="3,4">

English

<input type="number" value="3.4">

Notice how the page in french will not render the input tag because it the type is number but it is not a number in ENGLISH. Getting to my point, is ALL HTML attributes assumed in a standard HTML language (in English?).

When I create the input tag in HTML, would it have to be a 3.4 instead of 3,4?

And if my CultureInfo was set to French, will my browser display it as 3,4 on the page?

Yusuf Jama
  • 123
  • 13

1 Answers1

1

There's a difference between the internal representation of a number (which must always be as in a computer program, with a decimal dot and without thousands separators) and what the user sees when the input control is rendered in the browser (which may or may not follow the user's configured locale).

You must always use decimal dot in HTML code: <input type="number" value="3.4">.

This will display as [ 3.4 ] for English browsers and [ 3,4 ] for French browsers. The browser makes the conversion according to the user's language.

Locoluis
  • 784
  • 6
  • 8
  • when you say The browser makes the conversion according to the user's language, do you mean the Language of the system? – Yusuf Jama Aug 25 '17 at 13:05
  • At least in Chrome and Firefox, you can install language packs and change the language of the user interface of your web browser. This is independent from the operating system's language, and also affects the display of numbers in `` controls. – Locoluis Aug 25 '17 at 18:38