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 28550 - [FO31] format-number: "positive" and "negative"
Summary: [FO31] format-number: "positive" and "negative"
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Last Call drafts
Hardware: PC All
: P2 normal
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: 2015-04-23 15:09 UTC by Michael Kay
Modified: 2016-12-16 19:55 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2015-04-23 15:09:32 UTC
The use of the terms "positive" and "negative" in the spec of format-number() is not as precise as it could be.

4.7.3 bullet 1 says "If the picture-string contains two sub-pictures, the first is used for positive values and the second for negative values." (What about zero?)

4.7.4 para 2 says: "If there are two sub-pictures, then these rules are applied to one sub-picture to obtain the values that apply to positive numbers, and to the other to obtain the values that apply to negative numbers. "

4.7.5 rule 2 says: "In the rules below, the positive sub-picture and its associated variables are used if the input number is positive, and the negative sub-picture and its associated variables are used otherwise. Negative zero is taken as negative, positive zero as positive." (This implies that for decimals, where zero is unsigned, the negative sub-picture is used to format decimal zero, which would lead to it having a minus sign prepended.)

I think the problem is essentially editorial, there's no room for doubt about the intent, but it definitely needs tidying up.
Comment 1 Michael Kay 2015-04-23 15:24:35 UTC
I propose the following changes:

4.7.3 bullet 1 says "If the picture-string contains two sub-pictures, the first is used for positive *and unsigned zero* values, and the second for negative values."

4.7.4 para 2 says: "If there are two sub-pictures, then these rules are applied to one sub-picture to obtain the values that apply to positive *and unsigned zero* numbers, and to the other to obtain the values that apply to negative numbers. "

4.7.5 rule 2 says: "In the rules below, the positive sub-picture and its associated variables are used if the input number is positive, and the negative sub-picture and its associated variables are used *if it is negative. For xs:double and xs:float, the negative sub-picture is used for negative zero, the positive sub-picture for positive zero. For xs:decimal and xs:integer, the positive sub-picture is used for zero.*"
Comment 2 Michael Kay 2015-05-05 17:22:12 UTC
The change was accepted and has been applied.