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

RE: format-number

Subject: RE: format-number
From: "Lee, Insoo" <Insoo.Lee@xxxxxx>
Date: Wed, 26 Feb 2003 16:58:29 -0500
xsl fo format number
Thanks!
That's what I was looking for....

-----Original Message-----
From: G. Ken Holman [mailto:gkholman@xxxxxxxxxxxxxxxxxxxx] 
Sent: Wednesday, February 26, 2003 4:42 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  format-number


At 2003-02-26 16:30 -0500, Michael Semcheski wrote:
>I believe the poster was looking for information on whether a value 
>passed to format-number() that is not a number could be made to return 
>something other than NaN.
>
>I would be interested if anyone could comment.

If that is truly what the poster was asking for, that is what 
<xsl:decimal-format> is for.  An example is below.

I hope this helps.

................ Ken

T:\ftemp>type semcheski.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version="1.0">

<xsl:output method="text"/>

<xsl:decimal-format name="michael" NaN="not a nice number"/>

<xsl:template match="/">
   A:  <xsl:value-of select="format-number( 1.23, '#.000', 'michael' )"/>
   B:  <xsl:value-of select="format-number( 'ab', '#.000', 'michael' )"/>
   C:  <xsl:value-of select="format-number( 2.34, '#.000', 'michael' )"/>
</xsl:template>

</xsl:stylesheet>

T:\ftemp>saxon semcheski.xsl semcheski.xsl

   A:  1.230
   B:  not a nice number
   C:  2.340
T:\ftemp>



--
Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO
                              North America:      June 16-20, 2003

G. Ken Holman                mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.         http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                      Definitive XSLT and XPath
ISBN 0-13-140374-5                              Definitive XSL-FO
ISBN 1-894049-08-X  Practical Transformation Using XSLT and XPath
ISBN 1-894049-10-1              Practical Formatting Using XSL-FO
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc


 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.