This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21582 - format-number() and decimal-digit-family
Summary: format-number() and decimal-digit-family
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-04 18:08 UTC by Paul J. Lucas
Modified: 2013-04-23 17:06 UTC (History)
0 users

See Also:


Attachments

Description Paul J. Lucas 2013-04-04 18:08:26 UTC
XQuery Functions & Operators 3.0 [F&O] section 4.6.1 for format-integer() says in part:

> A mandatory-digit-sign is a ·character· in Unicode category Nd. All mandatory-digit-signs within the format token must be from the same digit family, where a digit family is a sequence of ten consecutive characters in Unicode category Nd, having digit values 0 through 9.

This is clear and precise.  It specifically disallows mandatory digits from different digit families.

[F&O] section 4.7.1 for format-number() says in part:

> The decimal digit family of a decimal format is the sequence of ten digits with consecutive Unicode ·codepoints· starting with the mandatory-digit-sign.

This is less precise since it does not explicitly disallow other characters in the format string that may be members of another digit family; or, if they are allowed, how they should be treated.

Additionally, section 4.7.3, "Syntax of the picture string," is silent on whether digits MUST be from the same digit family.
Comment 1 Paul J. Lucas 2013-04-04 18:11:44 UTC
IMHO, the rules for format-number() should also explicitly mention the Unicode category Nd just like the rules for format-integer().
Comment 2 Michael Kay 2013-04-23 13:27:46 UTC
I propose:

1) In 4.7.1, change the column-2 table entry for "mandatory digit" from "A single ·character·, which must be defined in Unicode as a digit" to "A single ·character·, which must be a chanracter in Unicode category Nd with decimal digit value zero".

2) Add to the Note at the start of 4.7.3: "The digits must all be from the same *decimal digit family*, that is, the set of 10 consecutive digits starting with the *mandatory digit-sign* defined in the decimal format.

I think these changes are purely editorial, in the sense that they do not say anything that cannot already be inferred. The discussion of the syntax of the picture string is clear, I think, that digits from the "decimal digit family" (a defined term) have a specific meaning, and that "any other character" (including a digit from a different digit family) is a passive character, which is allowed but has a different meaning.

I'm changing the status to "minor" which makes it an issue that can be resolved at the editor's discretion in that it does not affect any implementations or test cases.

Paul, as the originator, if you agree with this resolution, I would be grateful if you would mark this as closed.
Comment 3 Michael Kay 2013-04-23 13:34:53 UTC
In 4.7.1 I also changed column-3 of the mandatory-digit entry to read: "Defines the characters used in the picture string to represent a mandatory digit: for example, if the mandatory-digit-sign is "0" then any of the
         digits "0" to "9" may be used (interchangeably) in the picture string to represent a mandatory digit, and in the formatted number the characters "0" to "9" will
         be used to represent the digits one to nine."