2023 Jan 03 4:07 AM
how to achieve this result in abap is there a mathematical abap syntax i need to use or is there a function module for this?
expected result = 2455
data(a) = (4.33 * 14400 ) / 254 . " the result is 245.48
2023 Jan 03 9:10 AM
Your ABAP code calculates 245, not 245.48
But I understand what you mean, no need to show the calculation, you want to multiply 245.48 by 10 to get 2454.8 and round it to 2455.
You can use the ROUND function which does exactly what you ask. Any issue with it?
2023 Jan 03 8:28 AM
You have a syntax error anyway.
If you have numbers with decimals, you must define them as text literals:
data(a) = ( '4.33' / 14400 ) / 254.
the result is not 254.48, it's 0, and expected result is not 2455, it's 0.00000118
Please clarify
2023 Jan 03 8:30 AM
2023 Jan 03 8:51 AM
2023 Jan 03 8:55 AM
and I don't understand your question because the expected result is 245.48, not 2455...
2023 Jan 03 9:10 AM
Your ABAP code calculates 245, not 245.48
But I understand what you mean, no need to show the calculation, you want to multiply 245.48 by 10 to get 2454.8 and round it to 2455.
You can use the ROUND function which does exactly what you ask. Any issue with it?
2023 Jan 03 9:14 AM
for the round it is working.
and for the calculation i made a mistake it is 144000 not 14400 thats why i get 245.48
2023 Jan 03 9:17 AM
but is it possible to move the decimal point to the right ?
is there an abap syntax for that?
2023 Jan 06 2:55 PM