This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: sum function
- From: "cutlass" <cutlass at secure0 dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 16 Nov 2001 15:17:56 -0000
- Subject: Re: [xsl] sum function
- References: <4F213CE9D4A5D411B45D00508B6D701E0276D7E6@sv_nt_gos41>
- Reply-to: xsl-list at lists dot mulberrytech dot com
u may use
translate() function to replace all commas with nothing then your sum will
work
and you may also use the format-number() function to make a mask for
formatting the number
cheers, jim fuller
----- Original Message -----
From: "Hesselberth, Jan" <Jan.Hesselberth@northernrock.co.uk>
To: <XSL-List@lists.mulberrytech.com>
Sent: Friday, November 16, 2001 3:09 PM
Subject: [xsl] sum function
> How do I use the sum function on xml such as:
>
> <Amount>12,345.12</Amount>
> <Amount>132,345.12</Amount>
> <Amount>2,345.12</Amount>
>
> If I use Total Price = <xsl:value-of select="sum(//Amount)"/> I get the
> result NaN. However, if the data does not contain ',' the sum works
> correctly.
> Any help appreciated.
> Regards
> Jan
>
>
>
>
>
>
> --------------------------------------------------------------------------
> CONFIDENTIALITY
> The information contained in this e-mail and any files transmitted with it
> is private and confidential. It is intended for the named addressee only.
> If you are not the intended addressee you are prohibited from
> storing, copying or using the information in any way.
> If you received this e-mail due to a transmission error please notify the
> sender immediately. No liability is accepted by Northern Rock
> for any losses caused by viruses contracted during transit
> over the Internet or present in any receiving system.
> This e-mail is not intended to create legally binding commitments on
> behalf of Northern Rock plc, nor do its contents reflect the corporate
> views or policies of Northern Rock plc.
> --------------------------------------------------------------------------
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list