Subject: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.
Subject:Xquery returning odd number format Author:(Deleted User) 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.