OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: trying to use abs()

[ Lists Home | Date Index | Thread Index ]

I'd suggest something closer to the math definition of abs(x):

  x*(x >= 0) - x*(x < 0)


Cheers,
Dimitre Novatchev

"David Carlisle" <davidc@nag.co.uk> wrote in message 
200607061633.k66GX2Tt028633@edinburgh.nag.co.uk">news:200607061633.k66GX2Tt028633@edinburgh.nag.co.uk...
>
>> I would like to suggest a simple way
>> to implement abs() functionality in XSLT 1.0
>
> or even just select="number(translate(number(.),'-',''))"
>
> David
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
>
> 







 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS