This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: decimal points
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: subbu at boltblue dot com
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 5 Jul 2002 17:00:07 +0100
- Subject: Re: [xsl] decimal points
- Organization: Jeni Tennison Consulting Ltd
- References: <9723092BA4DBD111816D0000F6B093610C27E9E5@imsuklndsx1.lnd.uk.imshealth.com><00ba01c21dc1$c4e01a70$1802893e@ROSEBUD><1025883473.3d25bd51b03b9@www.boltblue.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
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