This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Disable showing of NaN
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Disable showing of NaN
- From: "West, Wilson Y." <WWest01 at Sidley dot com>
- Date: Thu, 11 Jan 2001 10:15:14 -0600
- Reply-To: xsl-list at lists dot mulberrytech dot com
Try this:
Define a format name, like so:
<xsl:decimal-format name="MyFormat" NaN=" - " zero-digit="0"/>
And use it with your format statement:
format-number(@totalAmt,'#,###','MyFormat')
Above I am displaying a dash instead of "NaN"
Hope this helps,
-WW
> -----Original Message-----
> From: Mazza, Glen [SMTP:glen.mazza@eds.com]
> Sent: Thursday, January 11, 2001 9:37 AM
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] Disable showing of NaN
>
> Simple question (no flaming here, I did check "Math" and "Formatting" off
> the XSL FAQ for the answer), how do I disable the showing of NaN if I am
> doing a division by zero?
>
> I know there is a xsl:decimal-format command with a NaN parameter I can
> set
> to "", but I don't know how to integrate it with format-number() as
> follows:
>
> <td align="right">
> <xsl:value-of select="format-number(total div sum(//ports/port/total) *
> 100,
> '#.00')"/>
> </td>
>
> Thanks,
> Glen Mazza
> glen.mazza@eds.com
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
------------------------------------------------------------------------------------------------------------
This e-mail is sent by a law firm and may contain information that is privileged or confidential. If you are not the intended recipient, please delete the e-mail and any attachments and notify us immediately.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list