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

Reduce the decimal placess without rounding..

Former Member
0 Likes
2,195

Hi Experts,

i have an issue like ...

i am using i am multiplifying DEC with CURR values in to CURR field with more then 2 decimal placess,

but i want update with 2 decimal placess, here the prob is if i take 2 decimal vanles it is rounding.

but i dont want rounding decimal.

ex: my value is like: lv_amt = 5.3578.

after taking with 2 decimals i am getting like : 5.36. but i want like 5.35.

i searched in sdn but i dint get proper result.

how to get this?

thanks in advance..

Regards,

SS.

Hi Experts,

i have an issue like ...

i am using i am multiplifying DEC with CURR values in to CURR field with more then 2 decimal placess,

but i want update with 2 decimal placess, here the prob is if i take 2 decimal vanles it is rounding.

but i dont want rounding decimal.

ex: my value is like: lv_amt = 5.3578.

after taking with 2 decimals i am getting like : 5.36. but i want like 5.35.

i searched in sdn but i dint get proper result.

how to get this?

thanks in advance..

Regards,

SS.

3 REPLIES 3
Read only

Former Member
0 Likes
1,923

try:

data: f1 type p decimals 5,
      f2 type p decimals 2,
      f3 type i.


f1 = '12.54821'.
f3 = trunc( f1 * 100 ).
f2 = f3 / 100.

write: / f1, f3, f2.

Read only

0 Likes
1,923

Hi Mean,

Thank u very much...

Read only

Former Member
0 Likes
1,923

HI,

First convert that value type to character, and then using WRITE TO statement you can move value to another one.

if you need not to do any manipulations further

because character types can not be manipulated.

or

declare another temporary valiable and then substract to 2 decimals, my suggestion is remove value from 2 dig from last.