2010 Mar 22 12:47 PM
Dear All expert,
I meet a problem.I need divide 60798.12345 by 1234.12385.Then I always got 0.00000000002 in the tartget field.
Do you have any suggestions about it ?
Many thanks in advance/
2010 Mar 22 1:09 PM
go to program attributes and check if "FIxed point Arithmetic" is checked or not..if not check the check box
go to program attributes and check if "FIxed point Arithmetic" is checked or not..if not check the check box
2010 Mar 22 12:51 PM
Can't replicate the problem...
data: p1 type p decimals 5,
p2 type p decimals 5,
p3 type p decimals 5.
start-of-selection.
p1 = '60798.12345'.
p2 = '1234.12385'.
p3 = p1 / p2.
write p3.49.26420
2010 Mar 22 12:57 PM
Hi,
Dont use DIV instead use /.
I used DIV i didnt get the proper result.Now i have pasted the code which worked for me.
>data: a type p decimals 5 value '1234.12385',
> b type p decimals 5 value '60798.12345',
> c type p decimals 5.
>
>
> c = b / a.
>
> write: C.
Regards,
Shanmugavel chandrasekaran
2010 Mar 22 1:09 PM
go to program attributes and check if "FIxed point Arithmetic" is checked or not..if not check the check box
2010 Mar 22 1:11 PM
Hi Joshua,
In SE38 Enter your program name and select ATTRIBUTES radio button. Check the Fixed Point arthimatic Check box.
You issue gets resolved.
REPORT ZTEST_NEW.
data : var1 type p DECIMALS 5 value '60798.12345',
var2 TYPE p DECIMALS 5 VALUE'1234.12385',
var3 TYPE p DECIMALS 5.
" If the Check box is not selected then the result is ,00049
var3 = var1 / var2. " This is a Checkd Code snippet
write var3. " and its value is 49.26420Cheerz
Ram
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |