2008 Feb 15 3:07 PM
I have an integer that used to be a string. This number is at least 10,000 (stored as 10000) and I would like to display it with the proper commas. Is there any way to do this short of looping through the string and inserting them?
Regards,
Davis
2008 Feb 15 3:17 PM
Hi,
You may be declared as char type thats why it is coming as a number without commas. But if you declare it as an integer then you get the commas.
Thanks
Sarada
Hi,
You may be declared as char type thats why it is coming as a number without commas. But if you declare it as an integer then you get the commas.
Thanks
Sarada
2008 Feb 15 3:17 PM
Hi,
You may be declared as char type thats why it is coming as a number without commas. But if you declare it as an integer then you get the commas.
Thanks
Sarada
2008 Feb 15 3:27 PM
I tried converting it to an integer but it does not add the commas. The issue is that the value is initially a character field (type ATWRT)
Regards,
Davis
2008 Feb 15 3:35 PM
Move it to an integer and again move into a char field as below ..
If U have v_atwrt as 10000010...
data : v_i type i ,
v_c(12).
v_i = v_atwrt+0(8). <-- move char to I
write v_i to v_c. <-- v_c contains 10,000,010
2008 Feb 15 3:54 PM
Srinivas, thanks. The issue was that I was doing the following:
temp_int = wa_items-ntgew.
temp_char = temp_int.
When I needed to do:
temp_int = wa_items-ntgew.
write temp_int to temp_char.
Thanks again,
Davis
2008 Feb 15 3:22 PM
Davis,
Try this...
write : l_amt USING EDIT MASK 'RR___,___,___.__'.
Hope this helps..
Chandra.
2008 Feb 15 3:25 PM
Move the integer to a char variable ... and the character variable will
display it with the proper commas.
data : v_i type i ,
v_c(12).
v_i = 10000010.
write v_i to v_c. <-- v_c contains 10,000,010
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |