<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21634</bug_id>
          
          <creation_ts>2013-04-09 02:54:33 +0000</creation_ts>
          <short_desc>format-number() suffix definition seems wrong</short_desc>
          <delta_ts>2013-04-23 17:11:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul J. Lucas">paul</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85768</commentid>
    <comment_count>0</comment_count>
    <who name="Paul J. Lucas">paul</who>
    <bug_when>2013-04-09 02:54:33 +0000</bug_when>
    <thetext>XQuery Functions and Operators 3.0, section 4.7.4, says in part:

&gt; The suffix is set to contain all passive characters to the right of the rightmost active character in the fractional part of the sub-picture.

Why doesn&apos;t that mirror the prefix definition?  The prefix definition is:

&gt; The prefix is set to contain all passive characters in the sub-picture to the left of the leftmost active character.

Specifically, why does the definition for suffix include &quot;the fractional part of&quot;? Why isn&apos;t the definition of suffix worded as:

&gt; The suffix is set to contain all passive characters to the right of the rightmost active character in the the sub-picture.

Including &quot;the fractional part of&quot; implies that, if there is no fractional part, then there can be no suffix.

For example, for the picture string &quot;1%&quot;, the % character is considered &quot;passive&quot; according to section 4.7.3; yet the current wording implies that there is no suffix because the % does not occur in the fractional part.  The upshot is that, according to the formatting rules in 4.7.5, the % will NEVER be included in the result string.

However, if the wording is changed as I&apos;ve proposed, then the % automatically becomes part of the suffix and gets included in the result as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86556</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-04-23 14:02:01 +0000</bug_when>
    <thetext>Actually the problem is subtly different from the way you describe it. The definition states: &quot;The &lt;var&gt;fractional part&lt;/var&gt; of the sub-picture is defined as the part that appears to the right of the &lt;var&gt;decimal-separator-sign&lt;/var&gt; if there is one; it is a zero-length string otherwise.

So there is always a fractional part; the problem is (a) the statement that it is a zero-length string if there is no decimal-separator-sign, and (b) the subsequent assumption that it contains at least one active character.

So I think 

(a) we should change the definition so instead of &quot;it is a zero-length string otherwise&quot;, we say &quot;or the part that appears to the right of the rightmost active character otherwise&quot;, and add &quot;The fractional part may be zero-length&quot;. 

(b) The problem that the fractional part may contain no active characters is then best dealt with by accepting your suggested wording: The suffix is set to contain all passive characters to the right of the rightmost active character in the the sub-picture.

I believe that these changes are editorial, in the sense that there is not really any alternative interpretation of what is written that would give different results. I have therefore classified the bug as &quot;minor&quot; and am resolving it as described here.

Paul, if you agree, please mark the issue closed, otherwise reopen and the full WG will look at it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>