Re: [xsl] formatting

Subject: Re: [xsl] formatting
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 19 Jul 2001 14:11:40 +0100
Hi Devan,

> How do I format numbers ??
>
> I thought that it was done as per the following :
>
> <xsl:template match="test">
>   <xsl:value-of select="format-number(.,'#,###,###,##0.00')"/>
> </xsl:template>

That's correct, given that the test element has a numerical value
(although format-number(., '#,##0.00') would do exactly the same
thing).

> but that doesn't seem to work.
> any ideas why that is ??

It's hard to say without being told in what way it isn't working (does
it raise an error, produce a string formatted in a different way,
produce nothing at all?). It would also help to see more of your
stylesheet, your source document and know what XSLT processor you're
using.

Possible problems are:

  * using WD-xsl rather than XSLT
  * not applying templates to the test element in your document
  * having a default decimal format that doesn't recognise ,s and .s
    as you've used them
  * having a non-numeric value for the test element

We should be able to work out which it is if you give us more
information.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread