2008 Nov 25 1:38 PM
Hi experts!!!
I need to cut the decimal part of my P data....
DATA: auxiliar type I,
aux type C,
valor type P decimals 2.
valor = '5.50'.
aux = FRAC( valor ).
auxiliar = trunc( valor ).
But when I do this, in aux parameter I only received 1... does anybody know the problem? How can I cut the decimal part of the number 5.50?
Aux = 0.50.. there's any way?
Thanks a lot!!
Regards,
Rebeca
2008 Nov 25 1:41 PM
DATA: auxiliar type I,
aux type Char10,
var1 and var2 type char10.
valor type P decimals 2.
valor = '5.50'.
move valor to aux.
SPLIT aux at '.' into var1 var2.
Var2 will have the decimal part.
Regards,
Prashant
DATA: auxiliar type I,
aux type Char10,
var1 and var2 type char10.
valor type P decimals 2.
valor = '5.50'.
move valor to aux.
SPLIT aux at '.' into var1 var2.
Var2 will have the decimal part.
Regards,
Prashant
2008 Nov 25 1:41 PM
DATA: auxiliar type I,
aux type Char10,
var1 and var2 type char10.
valor type P decimals 2.
valor = '5.50'.
move valor to aux.
SPLIT aux at '.' into var1 var2.
Var2 will have the decimal part.
Regards,
Prashant
2008 Nov 25 1:47 PM
Hi,
Try this
DATA d TYPE p DECIMALS 2.
data value type dmbtr value '5.50'.
d = FRAC( value ).
write : d.
regards,
Advait
2008 Nov 25 2:57 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |