[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] decimal points


Subject: Re: [xsl] decimal points
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 5 Jul 2002 17:00:07 +0100

Hi Subbu,

> i wana format $num which is a floating point num in such a way that
> i only have exactly 3 digits after decimal point..
> any help
> i used format-num() but it is rounding off

I guess you mean that you're using format-number(). The following
should work:

  format-number($num, '0.000')

If there's more than three decimal places, format-number() will round
to three decimal places; if there's less, it will add 0s to make it up
to three.

Cheers,

Jeni

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


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



Current Thread