W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2012

[whatwg] Decimal comma in numeric input

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 8 Feb 2012 00:39:20 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1202080030430.3868@ps20323.dreamhostps.com>
On Thu, 19 Jan 2012, John Tamplin wrote:
> 
> [...] a user types "1,575" in a field.  Is that interpreted as a value 
> between 1 and 2 or between 1000 and 2000? [...]

That's entirely up to the UA.


On Thu, 19 Jan 2012, Bronislav Klu?~Mka wrote:
> 
> This should depend on selected locale, is coma thousands or decimal 
> separator? Browser should follow such settings and display value 
> accordingly, but value MUST be sent to server according to 1 set of 
> rules, regardless of anything else (e.g. no thousands separator and full 
> stop as decimal separator). No browser locale, no server locale... one 
> set of rules. Consider JavaScript here... regardless of displayed value, 
> you always get Number type out of it (not string like 15.123,55 but 
> 15123.55) So it is just display here, but spec should explain the 
> difference between display value and underlying data.

Correct.


On Fri, 20 Jan 2012, Jukka K. Korpela wrote:
> 2012-01-20 1:19, David Singer wrote:
> > 
> > What the user enters and sees on screen is a presentational/locale 
> > issue
> 
> Which one?

That's defined by the UA. (The spec has some suggestions.)


On Fri, 20 Jan 2012, Cameron Heavon-Jones wrote:
> 
> The lang attribute is the structural declaration of the content's 
> localization, be it prose or data values.

Technically it just sets the language, not the localisation. I expect we 
will in due course add an attribute to explicitly set the locale of the 
content in the page. How it's rendered would then be controlled by new 
features in CSS (e.g. the page locale could be "British", and the 
presentation could be "American", which would mean dates would have their 
day and month fields flipped over). Similarly, the presentation layer 
ultimately controls the widgets, including how they work and what input 
formats they expect, e.g. through XBL or whatever replaces it.

This is all pie in the sky, though, it doesn't exist today.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 7 February 2012 16:39:20 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:39 UTC