ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » FLOAT type represented in scientific notation

Post new topic  Reply to topic
 FLOAT type represented in scientific notation « View previous topic :: View next topic » 
Author Message
iam_wmbuser
PostPosted: Tue Feb 17, 2009 3:27 am    Post subject: FLOAT type represented in scientific notation Reply with quote

Newbie

Joined: 24 Jul 2008
Posts: 7

I have a flow that is using XMLNSC parser. The flow retrieves data from a Sybase database and formats the data using an ESQL module to build the output message tree which is manipulated using a map node then sent out on MQ as an XML message. An XSD was used to define the output message definition.

One of the fields returned by the stored procedure is of Float datatype, with a value of 14.0 exactly.
When the message is output to XML the float field is mapped into an xs:decimal type with totalDigits=15 and fractionDigits=6 but the value is rendered in scientific notation as 1.4E1.
Whilst this is strictly correct it is not what the users want.

How can I control the rendering of the float? Ideally it should render as 14.0

I tried to CAST the float to CHARACTER when setting it in the ESQL but this also rendered the field in scientific notation.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Feb 17, 2009 3:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05615_.htm
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Feb 17, 2009 3:34 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
When the message is output to XML the float field is mapped into an xs:decimal type with totalDigits=15 and fractionDigits=6 but the value is rendered in scientific notation as 1.4E1.
The facets on a simple type control how it is validated, but they do not affect how it is written.
Quote:
I tried to CAST the float to CHARACTER when setting it in the ESQL
That's the correct approach. Keep trying
Back to top
View user's profile Send private message
iam_wmbuser
PostPosted: Tue Feb 17, 2009 4:38 am    Post subject: RTM! Reply with quote

Newbie

Joined: 24 Jul 2008
Posts: 7

Apologies, I really should have RTM.
For completeness I used the following ESQL to get the required output:

Code:
CAST (field AS CHARACTER FORMAT '##0.000')


I have a more general question now: can you stop the default conversion of FLOAT to CHARACTER rendering in scientific notation?

Explicting casting is fine for a small number of fields but if there is a way of supressing scientific notation in general that would be better.
Back to top
View user's profile Send private message
mgk
PostPosted: Tue Feb 17, 2009 5:23 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
can you stop the default conversion of FLOAT to CHARACTER rendering in scientific notation?


You can't as far as I am aware. You could change to use DECIMAL though which is a more accurate type and I think displays in non-scientific notation by default.


Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » FLOAT type represented in scientific notation
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.