Former Member

# value calculation

Hi All,

data : a(4) type n,

b(4) type n,

c type f.

a = 185.

b = 42.

c = a / b.

• ceal c.

write :/ c.

if c value is 15.38, I want round that value i.e 16.

Thanks and regards,

10|10000 characters needed characters exceeded

### Related questions

Former Member
Posted on Nov 22, 2007 at 07:20 AM

HI

data: l_1 type i, l_2 type p decimals 2.

l_2 = '1.78'.

l_1 = FLOOR( l_2 ).

l_1 = l_1 + 1.

write: l_1.

OR

use Function ceil.

w_qty = ceil( input_qty)

2)

use floor function

for example...

data: pd(5) type p decimals 2.

pd = '30.65'.

pd = ceil( pd ).

pd1 = floor( pd ).

write: pd, pd1

it will displayed as 30 and 31...

Message was edited by:

Muthurajan Ramkumar

10|10000 characters needed characters exceeded
• Posted on Nov 22, 2007 at 07:19 AM

Hi,

Declare c type numeric

Regards,

Prashant

10|10000 characters needed characters exceeded
• Former Member
Posted on Nov 22, 2007 at 07:27 AM

Hi

Try

data : a(4) type n,

b(4) type n,

c type f,

d type i.

a = 2185.

b = 42.

c = a / b.

• ceal c.

d = floor( c ) + 1.

write :/ c, d.

10|10000 characters needed characters exceeded
• Former Member
Posted on Nov 22, 2007 at 07:48 AM

Hi,

try this.

data a(4) type n,

b(4) type n,

c type p.

a = 185.

b = 42.

c = a / b.

write : / c.

declare c as packed type .

reward if useful.