RE: [xsl] format-number

Subject: RE: [xsl] format-number
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 2 May 2002 11:07:45 +0100
Having said that Saxon gives you "12.00", I'm afraid the XSLT 1.0 spec in
this area is very vague. It refers to the JDK 1.1 specifications, which
themselves are notoriously vague, so much so that we have rewritten them for
XSLT 2.0. In particular, I don't see anything in the Java specs that say
what should happen if the number is too large for the number of digits
specified (0.00 only allows one digit before the decimal point, but 12.00
requires two), so it's not surprising if different products give different
results.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
> David Zuccaro
> Sent: 02 May 2002 08:03
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] format-number
>
>
> Hi I'm having a problem with format number.
>
> This is my xml file:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <test>12.00</test>
>
> This is my xsl code:
> <?xml version='1.0' encoding='UTF-8' ?>
> <xsl:stylesheet version='1.0'
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
>     <xsl:template match="test">
>     	<output>
>     		<xsl:value-of select="format-number(., '0.00')"/>
>     	</output>
>     </xsl:template>
> </xsl:stylesheet>
>
> This is the output I am getting:
> <output>12</output>
>
> Shouldn't the output be:
> <output>12.00</output>
>
> I'm using xalan.
>
> Thanks in advance.
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread