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 » character to float conversion issue

Post new topic  Reply to topic
 character to float conversion issue « View previous topic :: View next topic » 
Author Message
dosttumhara1810
PostPosted: Thu Aug 15, 2013 5:42 am    Post subject: character to float conversion issue Reply with quote

Voyager

Joined: 01 Dec 2010
Posts: 76

hi ,

i am using below code to convert character to decimal for example if 10 is coming from channel in an xml message than it should be converted to 10.00 before sending it to target system.

DECLARE pattern CHARACTER '##0.00';
SET OutputRoot.XMLNSC.Response.Age = CAST(InputRoot.XMLNSC.Request.Age AS FLOAT FORMAT pattern) ;

Input: 2300
Output:2.3E+3

why the outpuut is like this..i want 2300.00
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Aug 15, 2013 5:57 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fak17810_.htm

Quote:
The FLOAT data type holds a 64-bit, base 2, fraction and exponent approximation to a real number. This gives a range of values between +-1.7E–308 and +- 1.7E+308.


Maybe you want DECIMAL datatype?

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fak17820_.htm

What makes you think FORMAT^PATTERN will apply to FLOAT type as output (ie. FORMAT^PATTERN only applies to CHARACTER, BIT, BLOB as output [re: character to float conversion issue])?

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fak05610_.htm


Quote:
To any of the string data types (BIT, BLOB, or CHARACTER) from any of the numeric and date/time data types in the previous list.


dosttumhara1810 wrote:
why the outpuut is like this..i want 2300.00


You need to acquire the knowledge to do this. Your current knowledge level is insufficient. What's your plan to acquire this skill ?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
dogorsy
PostPosted: Thu Aug 15, 2013 7:11 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

I agree with lancelotinc, you are casting as FLOAT, and then asking why you get a float in the output, can you not answer that yourself ?
Do you understand the different ESQL data types ? If you search for data types in the infocentre you will get some good info
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 » character to float conversion issue
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.