Re: parsing floating point values - user input for <input type="number"> in different locales

On Fri, 19 Jun 2009 21:45:15 +0200, Michael A. Puls II  
<shadow2531@gmail.com> wrote:

>> The browser can use locale-specific conventions in the user interface.
>
> Thanks.
>
> So, if the user locale uses "," and the users enters "1,5" in the field,  
> the UA would treat that as 1.5 hehind the scenes?

Yeah, it could do that.


> Is there anything in the spec that says this or is this just supposed to  
> be obviously implied?

I didn't find anything explicitly in the section bout type=number, but  
generally the spec does not have any UI requirements.


> What about markup?
>
> Will <input type="number" min="0,5" max="2,5" value="1,1" step="0,1">  
> work if the locale is correct?

No, you have to use "." in the markup.

-- 
Simon Pieters
Opera Software

Received on Monday, 22 June 2009 06:11:12 UTC