2010 Oct 01 11:00 AM
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.
2010 Oct 01 11:13 AM
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.
2010 Oct 01 11:29 AM
2010 Oct 01 11:27 AM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |