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

RE: Numbers containing 'e+..' not recognised as number

Subject: RE: Numbers containing 'e+..' not recognised as numbers
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 3 Jul 2005 21:26:01 +0100
number e
This format is inaccurately known in programming circles as "scientific
notation", though I've heard scientists refer to it as "Fortran notation".

There's no direct support for this format in XSLT 1.0. In 2.0, the number()
function will accept it happily. If you can't move to XSLT 2.0, it looks
like a job for an extension function.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Drew McLellan [mailto:lists@xxxxxxxxxxxxxxxx] 
> Sent: 03 July 2005 19:38
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Numbers containing 'e+..' not recognised as numbers
> 
> I'm using the MSXML2 processor form with an ASP script, trying to  
> transform a source xml document to xhtml.
> 
> The problem is that my source document contains elements with  
> attributes whose values are numeric. Sometimes these values are  
> expressed in a format such as "4.364976000000000e+002". The xsl  
> processor doesn't recognise these as numbers, and so format-number()  
> or any function that requires a number as input simply returns NaN.
> 
> I've tried using the number() function to convert to a number, but  
> this has been unsuccessful.
> 
> I'd be extremely grateful if anyone could
> 
> a) suggest a method to get these numbers recognised as numbers, or
> b) suggest the correct mathematical term for these 'e+..' numbers so  
> I can search more effectively!
> 
> I always [expletive deleted] at mathematics :)
> 
> many thanks,
> 
> drew.

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.