- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 12 Apr 2001 10:51:05 +0100
- To: "Kramer, Torsten (VIS93)" <Torsten.Kramer@victoria.de>
- Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
"Kramer, Torsten (VIS93)" <Torsten.Kramer@victoria.de> writes: > I am confused about the new facets 'totalDigits' and 'fractionDigits'. Is > the following a correct definition of a datatype which represents a number > with the format (-)nnnn.nn (valid: 9999.99, -9999.99, 12.5 invalid: > 10000.00): > > <simpleType name="myNumberType"> > <restriction base="number"> > <totalDigits value="6"/> > <fractionDigits value="2"/> > </restriction> > </simpleType> > > Is my assumption right that the sign and the decimal point are not included > in the value for 'totalDigits'? I get confused about this myself :-( but in the absence of any other answer, I'll do my best. totalDigits of 6 constrains you to numbers whose absolute value is in the range 999999 to .000001, with a maximum of 6 significant digits, i.e. leading and trailing zeros don't count. So 10000.00 _is_ OK. fractionDigits of 2 constrains you to numbers with at most two (significant) digits to the right of the decimal point. So these are all good: 1 .1 11 1.1 .11 111 11.1 1.11 1111 111.1 11.11 11111 1111.1 111.11 111111 11111.1 1111.11 as are their negations, and anything you can get by replacing '1' with any other digits, and/or by adding zeros at the beginning or the end. And that's it. Nothing else is allowed (I think). Hope this helps. ht -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh W3C Fellow 1999--2001, part-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/
Received on Thursday, 12 April 2001 05:51:44 UTC