cancel
Showing results for 
Search instead for 
Did you mean: 

rounding the decimal values in forms

Former Member
0 Kudos

hi experts in my forms one weight field is there like 'brgew'. but it displaying some decimal. i don't want decimals what to do. how can i round that value.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Pammi,

If your field is EKPO-MENGE and wants to display without decimals then use the following statement in your script editor.

<b>/: &EKPO-MENGE&(.0)</b>

Syntax:

<b>&symbol(.N)&</b>

Here N represents how many decimals should be on to output of a symbol.The symbol should be one of the data types DEC, QUAN or FLTP.

Check this link for formatting options about scripts

http://help.sap.com/saphelp_47x200/helpdata/en/d1/8032cc454211d189710000e8322d00/frameset.htm

Thanks,

Vinay

Former Member
0 Kudos

Hi,

Use (.1) in your variable..

Example..

&EKPO-MENGE(.0)&..

I believe this round it..

Check this link for help..

http://help.sap.com/saphelp_46c/helpdata/EN/d1/803479454211d189710000e8322d00/content.htm

Thanks,

Naren

Former Member
0 Kudos

hi

take second variable of type i and move variable1 to variable 2 then your value gets roundoff like 219.67 to 220

or

take second variable of type c and in write statement

write v1 to v2 decimals 0

go through type conversions you can solve all these kind of issues

Regards

Phani

Former Member
0 Kudos

use as ur requerment for rounding..

check this example...

DATA: I TYPE I,

P TYPE P DECIMALS 2,

M TYPE F VALUE '-3.5',

D TYPE P DECIMALS 1.

P = ABS( M ). " 3,5

I = P. " 4 - business rounding

I = M. " -4

I = CEIL( P ). " 4 - next largest whole number

I = CEIL( M ). " -3

I = FLOOR( P ). " 3 - next smallest whole number

I = FLOOR( M ). " -4

I = TRUNC( P ). " 3 - integer part

I = TRUNC( M ). " -3

D = FRAC( P ). " 0.5 - decimal part

D = FRAC( M ). " -0.5

Former Member
0 Kudos

it's not decimal places in weight filed some value like 441.967 values is coming i have to round that in forms like 442.

Former Member
0 Kudos

Hi

Declare tmp1 type p (without decimals).

tmp1 = (your selected value)

Write tmp1 .....

Former Member
0 Kudos

take field as data: V1 type p decimals 2,

V2 type p.

move brgew to V1.

now, move V1 to V2 due to which decimals are truncated.