Number Formats (was [whatwg] Web Forms 2.0 - Comments on sections 1 and 2)

Dean Edwards dean at
Mon Jun 14 11:38:49 PDT 2004

Ian Hickson wrote:

> On Thu, 10 Jun 2004, Dean Edwards wrote:
>>whilst we're talking about numbers...
>>a common scenario in web apps is to have a separate format for
>>displaying numbers (e.g. currencies). The user enters "19" but after
>>tabbing to the next field this is then displayed as "$19.00". focus/blur
>>events are usually used to format/unformat the underlying value. is it
>>too late to formalise something like this by introducing a "format"
>>attribute? i could have really used it on the last project i worked on.
> We could do that; could you propose some text? I'm not familiar with the
> requirements.
> Would it just be:
>    format="$%02.2d"
> ...? Where that's basically a subset of the printf format specifier
> functionality?
unfortunately the formats i've worked with most are microsoft style 
format patterns (and we don't want to use those do we?). i'll leave it 
to others more experienced in defining things like this to suggest 
suitable patterns. :-)
we should also apply this to date and time types of course.

More information about the whatwg mailing list