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: 

How to remove unwanted zeros of the number after decimal point

Former Member
0 Kudos

Hi experts.

I have a variable X(type C) = 12345.00 in print program and would like to remove zeros after decimal value to display the same in existing form [based on requirement].

plz help me.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

write the variable in the form as &v_val(.0)&

кu03B1ятu03B9к

6 REPLIES 6

Former Member
0 Kudos

Hi Sriram,

If you dont want to display the ZEROS after decimals at all then move the contents of the variable to an Integer variable.

This will automatically remove zeros.

Regards,

Prakash Pandey

Former Member
0 Kudos

write the variable in the form as &v_val(.0)&

кu03B1ятu03B9к

former_member203501
Active Contributor
0 Kudos

hi use like this ...

&VBRP-FKIMG(.0)& will give no decimal places

&VBRP-FKIMG(.2)& will give two decimal places

0 Kudos

thanks boss..you have given excellent solution to my problem,but one more suggestion is required for the same...

How to round off the value in the lay out itself without do any chnges in print program?!

My requirement is: remove zeros after decimal by rounding the value in layout display.

For Ex; &varr& = 123.50 should be shown as 124 in layout

0 Kudos

thanks boss.for your suggestion,still i require further suggestion to close myrequirement.

How to round off the value in the lay out itself without do any changes in print program?!

My requirement is: remove zeros after decimal by rounding the value in layout display.

For Ex; &varr& = 123.50 should be shown as 124 in layout

0 Kudos

hi this is your answer...

please search for the answers before posting