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 » String to Numeric with Decimal Point

Post new topic  Reply to topic
 String to Numeric with Decimal Point « View previous topic :: View next topic » 
Author Message
mikeaadam
PostPosted: Tue May 06, 2003 4:05 pm    Post subject: String to Numeric with Decimal Point Reply with quote

Newbie

Joined: 30 Apr 2003
Posts: 3

Hi,

I need to convert a string to 2 decimal places, right justified, and padded with zeros.

For example,

Input Data
5

Output Data (fixed length of 10)
0000005.00

Thanks.
Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Tue May 06, 2003 8:40 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

try this,

Code:

CAST(inputdata AS DECIMAL(10,2))

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Balraj Muthupandiyan
PostPosted: Wed Mar 09, 2005 7:29 am    Post subject: Reply with quote

Newbie

Joined: 08 Mar 2005
Posts: 3

Hello Kirani:

If I use the statment CAST(inputdata AS DECIMAL(10,2)) the result is coming out as 5.00 and all the leading zeros are truncated in Version 5. But it works in Version 2.

Is there anyway to avoid leading zero truncation in Version 5?

thanks in advance.
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Mar 09, 2005 9:33 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Were you expecting a different answer in this thread.

http://www.mqseries.net/phpBB2/viewtopic.php?t=20919&highlight=

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
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 » String to Numeric with Decimal Point
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.