Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

formatting issue

former_member188827
Active Contributor
0 Kudos
52

hi,

the data type which iam using is wertv9 (it's length is 17,it is dictionary type ) ,sometime my value culd be less then 17 digits like 6 or 7 digits. when i print the variable of type wertv9 i get leading spaces.I cannot move it into character type variable becoz the commas which need to be displayed are removed when it is moved to character type variable.

can anyone suggest as how to remove leading space & KEEP the comma's as well.

e.g:

12345,56.89(this is how iam getting)

12345,56.89(this is wht is required).

points will be rewarded.

1 ACCEPTED SOLUTION

rodrigo_paisante3
Active Contributor
0 Kudos
29

Hi,

try to create a temp var type C with the length of the currency field you want. then, use the write command and the condense command. Like this:

data: v type wertv9,

x(17) type c.

...

write: v to x.

condense x.

write x.

The space will remove and the comma will keep.

Reward if useful!

Reagards,

RP

1 REPLY 1

rodrigo_paisante3
Active Contributor
0 Kudos
30

Hi,

try to create a temp var type C with the length of the currency field you want. then, use the write command and the condense command. Like this:

data: v type wertv9,

x(17) type c.

...

write: v to x.

condense x.

write x.

The space will remove and the comma will keep.

Reward if useful!

Reagards,

RP