|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
String to Numeric with Decimal Point |
« View previous topic :: View next topic » |
Author |
Message
|
mikeaadam |
Posted: Tue May 06, 2003 4:05 pm Post subject: String to Numeric with Decimal Point |
|
|
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 |
|
 |
kirani |
Posted: Tue May 06, 2003 8:40 pm Post subject: |
|
|
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 |
|
 |
Balraj Muthupandiyan |
Posted: Wed Mar 09, 2005 7:29 am Post subject: |
|
|
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 |
|
 |
EddieA |
Posted: Wed Mar 09, 2005 9:33 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|