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: 

Datatype conversion for Displaying

Former Member
0 Kudos

Hi

There is a variable which is stored internally in the form of Decimal( Length: 3 & Dec. Plcs:2 ). For Eg., X = 0.50.

I want to display this variable on the UI as X = 50%.

Is there an in-built feature to convert the datatype of this variable just for the purpose of displaying and without changing the internal datatype( decimal ).

Please help.

Thanks

Sukanya

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

There is no readymade data element or doman to show the percentages.

You have to cook your own logic to show it is %.

Data: v_per type i,
         v_per_char(5).

i = x * 100.
v_per_char = v_per.
condense v_per_char.
concatenate v_per_char '%' into v_per_char.
write:/ v_per_char.

Regards,

Ravi

former_member181962
Active Contributor
0 Kudos

There is no readymade data element or doman to show the percentages.

You have to cook your own logic to show it is %.

Data: v_per type i,
         v_per_char(5).

i = x * 100.
v_per_char = v_per.
condense v_per_char.
concatenate v_per_char '%' into v_per_char.
write:/ v_per_char.

Regards,

Ravi

former_member181962
Active Contributor
0 Kudos

There is no readymade data element or doman to show the percentages.

You have to cook your own logic to show it is %.

Data: v_per type i,
         v_per_char(5).

i = x * 100.
v_per_char = v_per.
condense v_per_char.
concatenate v_per_char '%' into v_per_char.
write:/ v_per_char.

Regards,

Ravi

Former Member
0 Kudos

Hi..

data: w_pack type p decimals 2 value '0.55'.

<b>write: w_pack round -2 using edit mask '__%'.</b>