XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
guy-francis vellaSubject: Xquery returning odd number format
Author: guy-francis vella
Date: 29 Jun 2009 10:53 PM
Afternoon All

In a batch of 680+ contracts I am turning into XML using a XQuery I have one number that get processed oddly. I know why, but i can't work out how to change it.

The number is 2197984.800

In the XML this is reproduced as 2.1979848E6

I can see that this is a number length issue, but I have no idea where to go and change this setting, if indeed it is a setting.



Alberto MassariSubject: Xquery returning odd number format
Author: Alberto Massari
Date: 30 Jun 2009 11:36 AM
Hi Guy,
what you are seeing is the standard way of converting a number to a string.
In short, the specs say that a float or double number will be serialized as a decimal value if its absolute value is between 0.000001 (one millionth) and 1000000 (one million), otherwise the exponential notation xxxEyyy will be used.
If you want to force the decimal display you will have to explicitly cast the value to be a xs:decimal.

Hope this helps,

Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.