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

Re: Formatting negative numbers with format-number

Subject: Re: Formatting negative numbers with format-number
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Wed, 07 Jul 2004 14:36:58 -0600
xsl if negation
Youre easiest solution would be to use starts-with as so:

<xsl:if test="starts-with(string($number), '-')"><xsl:value-of select="$number * -1"/></xsl:if>

or the same style using the substring-after method...

<xsl:if test="starts-with(string($number), '-')"><xsl:value-of select="concat('(', substring-after(string($number), '-'), ')')"/></xsl:if>

Either way, this should work...

Regards,

<M:D/>

Jaime Stuardo wrote:

Hi all...

Is it posible using format-number function that the negative numbers to be displayed enclosed in brackets? for example, -1234 = (1234)

Jaime

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--+--


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.