[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SV: Disable showing of NaN

Subject: SV: Disable showing of NaN
From: Jonas Nordström <Jonas.Nordstrom@xxxxxxxxxxx>
Date: Thu, 11 Jan 2001 17:03:54 +0100
xsl nan value
Maybe this will work (I can't try it right now). Assign the value to a
variable, test the variable for the 'NaN' value. Display the variable if it
is something else.

<td align="right">
<xsl:variable name="num" select="format-number(total div
sum(//ports/port/total) * 100,'#.00')"/>
<xsl:if test="$num!='NAN'">
   <xsl:value-of select="$num"/>
</xsl:if>
</td>

/Jonas

-----Ursprungligt meddelande-----
Från: Mazza, Glen [mailto:glen.mazza@xxxxxxx]
Skickat: Thursday, January 11, 2001 4:37 PM
Till: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Ämne:  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@xxxxxxx

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

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.