/scripts/ahub.form.attachments.js
0

Conversion: TO_CHAR issue in SAP Infosteward

Feb 02, 2017 at 05:11 PM

91

avatar image
Former Member

Hi All,

I've an issue in formatting a decimal type field with thousands & comma separator using 'to_char' in SAP Infosteward 4.2.

Here is the scenario:

Input: 12345.67

Desired output: 12,345.67

I've used the conversion as "to_char("12345.67", '9G999D.99') but I get the result as '345.67' instead of '12,345.67'.

Any help in resolving the issue is much appreciated.

Thanks,

Mani R

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Doug Staub
Feb 09, 2017 at 02:16 PM
0

Hi Mani,

Your screenshot shows you are converting a decimal to a varchar but you are putting the results back into a decimal column. Try changing this so the result of the to_char() function is output to a varchar column. Thanks.

Doug

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Awesome - Nice catch. Thanks Doug.

The issue is resolved now.

0
Doug Staub
Feb 02, 2017 at 07:24 PM
0

Hi Mani,

Try the following:

to_char(12345.67, '99G,999D.99')

This works correctly for me and returns '12,345.67'


Regards,


Doug

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 02, 2017 at 07:58 PM
0

Doug,

Thanks for your reply. Unfortunately it's not working. I see <null> for values greater than 999.99. For instance value of '999.99' shows up correctly in the output view but value of '1000.11' shows up as <null>.

Here is my conversion statement

Thanks,

Mani. R


to-char.jpg (12.2 kB)
Share
10 |10000 characters needed characters left characters exceeded
Skip to Content