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: 

discard after decimal point.........

Former Member
0 Kudos
168

hi gurus.....

I have quantity amount which comes in the output as 200.0000

i want to take only the 200 , after the decimal point i want to discard it

can u help me out how that can be dont

I want to display as only 200

Thankyou so much

1 ACCEPTED SOLUTION

Former Member
0 Kudos
130

Hi,

check the forum

or use

SHIFT varb1 RIGHT DELETING TRAILING '.'.

or use the fm to get 124.800 as 124.8

FTR_CORR_SWIFT_DELETE_ENDZERO

Regards

6 REPLIES 6

Former Member
0 Kudos
130

Hi,

data: text2(20) type c,

text3(3) type c,

text1 = 200.0000

split text1 at ',' into text2 text3.

write: text2.

or

SHIFT text1 LEFT DELETING LEADING ','.

Regards

Nicole

Former Member
0 Kudos
130

hi,

take another variable with type P decimals 0...move the value to this variable.

eg: data : netpr TYPE netpr value '200.000',

v1(15) TYPE p decimals 0.

v1 = netpr.

write v1.

output: 200

Hope it helps!

Regards,

Pavan

faisal_altaf2
Active Contributor
0 Kudos
130

Hi,

Use the following Sample Code use floor

data: dec TYPE p DECIMALS 3 VALUE '2.000', " or if Value will be 2.999 will also return you 2
      with_out_fp TYPE string.

with_out_fp = floor( dec ).
WRITE: with_out_fp.

Best Regards,

Faisal

Former Member
0 Kudos
131

Hi,

check the forum

or use

SHIFT varb1 RIGHT DELETING TRAILING '.'.

or use the fm to get 124.800 as 124.8

FTR_CORR_SWIFT_DELETE_ENDZERO

Regards

Rushikesh_Yeole
Contributor
0 Kudos
130

You can use the in-built function TRUNC(num)...check it out....

0 Kudos
130

Or else you can declare the variable as VAR DECIMALS 0.