[Bug 29555] [FO31] 9.8.4.2 The Width Modifier

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29555

--- Comment #3 from Michael Kay <mike@saxonica.com> ---
Yes, the rules for fractional seconds are seriously under-specified.

It really doesn't make sense to allow [f###000], rather it makes sense to allow
[f000###].

I think we probably need a separate section for formatting fractional seconds,
rather as we introduced a new section for formatting timezones. Since grouping
separators in the fractional part are so badly broken at the moment as to be
effectively useless, I propose to disallow them. This suggests the following
text:

9.8.4.4 Formatting Fractional Seconds

Special rules apply to the formatting of timezones. When the component
specifier f is used, the rules in this section override any rules given
elsewhere in the case of discrepancies.

For the fractional seconds component:

* the first presentation modifier must take the form \d+#* (that is, one or
more digits followed by zero or more '#' signs). All digits must be from the
same decimal digit family.

* the second presentation modifier must be absent.

* the formatting is controlled by three parameters: the decimal digit family,
the
minimum width, and the maximum width.

** The decimal digit family is the Unicode digit family used for the digits in
the first presentation modifier

** If a width modifier is present, then the minimum and maximum width are
determined by the width modifier as described in ยงยงยง.

** Otherwise (when no width modifier is present):

*** if the first presentation modifier consists of a single digit, then the
minimum width is one and the maximum width is infinity.

*** otherwise, the minimum width is the number of digits in the first
presentation modifier, and the maximum width is the total number of characters
in the first presentation modifier

The actual value of the fractional seconds in the input value is then formatted
as follows:

1. Let V be the value of seconds-from-dateTime(xs:dateTime($value)) mod 1.

2. Let W be the value of round-half-to-even(V, M) where M is the maximum width.

3. Cast W to a string and take the substring after the decimal point.

4. Add trailing zeroes if necessary to pad the value to the minimum width.

5. Replace all digits by corresponding digits from the selected decimal digit
family.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 19 April 2016 09:42:43 UTC