W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2001

Clarification for format-number()

From: Bjorn Reese <breese@mail1.stofanet.dk>
Date: Thu, 1 Feb 2001 13:48:21 -0500 (EST)
Message-ID: <3A79AFDE.48C00051@mail1.stofanet.dk>
To: xsl-editors@w3.org
While implementing format-number() in a non-Java programming language I
encountered problems with the vague description in JDK 1.1, which XSLT 1.0
refers to. I therefore seek clarification for a couple of issues. I realize
that these are mainly JDK related issues, but since XSLT includes these, I
feel confident that I am asking in the right forum.

 1. Does leading integer digits (#) impose a maximum width of the integer
    part of the output number? For example, must all four digits in 9999
    be printed in the following expression, or only the last three?

      format-number(number, '#00')

    If four, what is the purpose of having # characters in the integer part?

 2. JDK 1.1 does not specify where the minus sign, percent, and per-mille
    characters may or may not occur in the format string. I assume that the
    minus sign must be immediately before the integer part, and that the
    two others must follow immediately after the fraction part, but according
    to the pseudo-BNF, they, together with the minus sign, cannot be part of
    the format string at all.

 3. How is the quote character inserted into the format string? For example

      <xsl:value-of select="format-number(number, 'how-do-I-quote-here0?')"/>

    The problem above is that the quote character already is used to specify
    the second argument, and the double-quote is used to specify the argument
    for the select attribute.

 4. What are the '_' and '*' characters that JDK 1.1 refers to? (second
    paragraphs in the Notes section). Can I safely ignore those?

Thank you.
Received on Sunday, 4 February 2001 10:08:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:52 GMT