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

Re: Working with Scientific Notation

Subject: Re: Working with Scientific Notation
From: Jeff Kenton <jkenton@xxxxxxxxxxxxx>
Date: Fri, 04 Oct 2002 12:38:36 -0400
xpath scientific notation
Michael H. Semcheski wrote:
Hello,

I was wondering if anyone knows of a good way to convert very small numbers represented in scientific notation to a standard decimal.

The situation is this:
...
Many of the values that are formatted as percents in excel show up in scientifc notation (eg -9.1053999999999996E-2) in the xml output. When I try to format them with format-number(), they show up as NaN.

I assume from your comments that you have already discovered that XSLT 1.0 doesn't handle scientific notation (XSLT / XPath 2.0 will).


My recommendation is to do this as a string processing operation, with as little math as possible. Just count the digits on both sides of the decimal point, find the value of the exponent, and move the decimal point to the right place, inserting extra zeros as necessary. Use the programming language of your choice (not necessarily XSLT), depending on your intermediate file format.

Good luck.


-- -------------------------- Jeff Kenton DataPower Technology, Inc.



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.