W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2010

[Bug 8503] [FO 1.1] grouping separators in format-integer

From: <bugzilla@wiggum.w3.org>
Date: Wed, 13 Jan 2010 11:07:15 +0000
To: public-qt-comments@w3.org
Message-Id: <E1NV14F-0000ZI-88@wiggum.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=8503





--- Comment #1 from Michael Kay <mike@saxonica.com>  2010-01-13 11:07:14 ---
To achieve this effect, I propose to replace the two paragraphs following "The
primary format token is one of the following" by:

<new>
A decimal-digit-pattern made up of optional-digit-signs, mandatory-digit-signs,
and grouping-separator-signs.

* an optional-digit-sign is the character "#".

* a mandatory-digit-sign is a Unicode character in 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 Unicode
characters in category Nd, having digit values 0 through 9. Within the format
token, these digits are interchangeable: a three-digit number may thus be
indicated equivalently by 000, 001, or 999.

* a grouping-separator-sign is a non-alphanumeric character, that is a
character whose Unicode category is other than Nd, Nl, No, Lu, Ll, Lt, Lm or
Lo.

There must be at least one mandatory-digit-sign. There may be zero or more
optional-digit-signs, and (if present) these must precede all
mandatory-digit-signs. There may be zero or more grouping-separator-signs. A
grouping-separator-sign must not appear at the start or end of the
decimal-digit-pattern, nor adjacent to another grouping-separator-sign.

The corresponding output format is a decimal number, using this digit family,
with at least as many digits as there are mandatory-digit-signs in the format
token. Thus, a format token 1 generates the sequence 0 1 2 ... 10 11 12 ...,
and a format token 01 (or equivalently, 00 or 99) generates the sequence 00 01
02 ... 09 10 11 12 ... 99 100 101. A format token of &#x661; (Arabic-Indic
digit one) generates the sequence &#1633; then &#1634; then &#1635; ...

The grouping-separator-signs are handled as follows. The position of grouping
separators within the format token, counting backwards from the last digit,
indicates the position of grouping separators to appear within the formatted
number, and the character used as the grouping-separator-sign within the format
token indicates the character to be used as the corresponding grouping
separator in the formatted number. If grouping-separator-signs appear at
regular intervals within the format token, that is if the same grouping
separator appears at positions forming a sequence N, 2N, 3N, ... for some
integer value N (including the case where there is only one number in the
list), then the sequence is extrapolated to the left, so grouping separators
will be used in the formatted number at every multiple of N. For example, if
the format token is 0'000 then the number one million will be formatted as
1'000'000, while the number fifteen will be formatted as 0'015.

The only purpose of optional-digit-signs is to mark the position of
grouping-separator-signs. For example, if the format token is #'##0 then the
number one million will be formatted as 1'000'000, while the number fifteen
will be formatted as 15. A grouping separator is included in the formatted
number only if there is a digit to its left, which will only be the case if
either (a) the number is large enough to require that digit, or (b) the number
of mandatory-digit-signs in the format token requires insignificant leading
zeros to be present.

NOTE: numbers will never be truncated. Given the decimal-digit-pattern 01, the
number three hundred will be output as 300, despite the absence of any
optional-digit-sign.
</new>

NOTE ALSO (SEPARATE BUG): in the definition of format-number(),
optional-digit-sign is described thus: "A single character, which must be
defined in Unicode as a digit with the value zero". Delete "with the value
zero", as we have removed this constraint.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Wednesday, 13 January 2010 11:07:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:29 UTC