[Bug 29488] [QT3] format-integer-030

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

--- Comment #19 from Michael Kay <mike@saxonica.com> ---
I propose to clarify the specification to say:

The *position* of a grouping separator is the number of optional-digit-signs
and mandatory-digit-signs appearing between the grouping separator and the
right-hand end of the primary format token.

Grouping separators are defined to be *regular* if:

* there is at least one grouping separator
* every grouping separator is the same character C
* there is a positive integer G (the grouping size) such that:

** the position of every grouping separator is an integer multiple of G

** every positive integer multiple of G that is less than the number of
optional-digit-signs and mandatory-digit-signs in the primary format token is
the position of a grouping separator.

The *grouping separator template* is a (possibly infinite) set of (position,
character) pairs. 

* If grouping separators are regular then the grouping separator template
contains one pair of the form (n*G, C) for every positive integer n where G is
the grouping size and C is the grouping character.

* Otherwise, the grouping separator template contains one pair of the form (P,
C) for every grouping separator found in the primary formatting token, where C
is the grouping separator character and P is its position.

Note: if there are no grouping separators, the grouping separator template is
an empty set.

The number is formatted as follows:

1. The number is formatted in decimal notation as if by casting the supplied
integer to a string.

2. If the number of digits is less than the number of mandatory-digit-signs in
the primary format picture then it is extended on the left with leading zeroes
to make it up to this size.

3. All digits 0-9 are replaced by corresponding digits from the selected digit
family, producing a string S.

4. For every (position P, character C) pair in the grouping separator template
where P is less than the number of digits in S, character C is inserted into S
at position P (counting from the right-hand end).

5. If the ordinal modifier is present, then the resulting string is converted
into ordinal form as described below.


I don't propose to extend the specification to handle the "phone number" use
case, by allowing grouping separators to appear at the start or end, or
adjacent to each other. I don't think the spec was intended for this purpose
and the changes would be non-trivial.

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

Received on Monday, 14 March 2016 16:34:10 UTC