Application Development and Automation 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: 
Read only

rounding off

Former Member
0 Likes
860

hi all,

Please help me in this issue i am having a value of some 398.98 it should be rounded off to 390and should be sent to Write statement. please suggest on the same

Regards

reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
839

Hi,

Use ceil( ) function.

Ex. a = ceil ( 398.98).

wreite:/ a.

Regards,

Subha.

6 REPLIES 6
Read only

Former Member
0 Likes
839

Hi try like this..

var = ceil ( var ).

WRITE 😕 var DECIMALS 0.

Message was edited by:

Perez C

Read only

former_member386202
Active Contributor
0 Likes
839

Hi,

Just read last 2 digits of your value using offset, then check if it is greater than 50 then add 1 to your variable otherwise do nothing.

Regards,

Prashant

Read only

Former Member
0 Likes
839

HI

Either use CEIl or TRUNC for the nuemric field it will remove the decimal place

otherwise use split to get the value

Regards

Shiva

Read only

Former Member
0 Likes
840

Hi,

Use ceil( ) function.

Ex. a = ceil ( 398.98).

wreite:/ a.

Regards,

Subha.

Read only

Former Member
0 Likes
839

use

ceil function

for example,

data: pd(5) type p decimals 2 value '5.10'.

pd = ceil( pd ).

write pd.

Read only

Former Member
0 Likes
839

Hi Reddy ,

You can use the Fm "ROUND".

or

use the ceil function.

DATA: I TYPE I,

P TYPE P DECIMALS 2,

P = 3.6.

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

I = CEIL( M ). " 3

Reward If useful.

Regards,

Chitra