on 05-07-2009 7:08 AM
Hi experts
Iam trying to multiply
Data : l_answer type i.
l_answer = 1 * 1.5
I would get a answer as 2
But what i want is 1 , i just need to exclude values after decimals , meaning i dont want values to get rounded off
Hi,
You can use type casting.
Example:
data: var_float TYPE p DECIMALS 2 VALUE '1.5',
var_int TYPE i.
var_int = var_float .
var_int ll be having value 1
I hope it helps
Regards,
Rohit
Edited by: Rohit Makkar on May 7, 2009 11:54 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try using data type p
data: l_f type p DECIMALS 3 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can try like this:
Data : l_answer type string.
data l_ans type string.
data l_ans1 type string.
l_answer = 1 * '1.5' .
split l_answer at '.' INTO: l_ans l_ans1.
Regards
Arjun
P.S.: Please post ABAP related questions in ABAP,general forum.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please post the same in ABAP General fourm.
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.