This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: number("2,000") -> NaN
- From: Joerg Heinicke <joerg dot heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 05 Feb 2002 11:24:01 +0100
- Subject: Re: [xsl] number("2,000") -> NaN
- References: <Pine.LNX.4.33.0202051101030.20216-100000@ssh.it-c.dk>
- Reply-to: xsl-list at lists dot mulberrytech dot com
For removing or replacing one character, you can use the
translate()-function.
<xsl:value-of select="translate(any_number, ',', '')"/>
replaces every comma by 'nothing'.
Now you have a number.
Regards,
Joerg
Morten Primdahl wrote:
> Hi. Xalan-J outputs <xsl:number level="any"/> formatted
> with grouping separator , (comma) as in 1,024
>
> I need a numerical value which I can do some arithmetic
> on. I tried using the number() function, but to no avail.
> How can I strip the grouping separator or get a proper number
> rather than the formatted string?
>
> Thanks,
>
> Morten
--
System Development
VIRBUS AG
Fon +49(0)341-979-7411
Fax +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list