cancel
Showing results for 
Search instead for 
Did you mean: 

Can't we multiply decimal numbers in SAP ABAP?

yalcin_mete
Participant
0 Kudos

Hi Masters,
Programming languages ​​are primarily expected to perform mathematical operations correctly.
I tried a lot of data types, but I couldn't multiply two decimal numbers into the abap program properly.

Can you help me ?

 

yalcin_mete_0-1715283033553.png

thanks

 

 

Sandra_Rossi
Active Contributor
0 Kudos
It has been discussed a lot -> search program attribute fixed-decimal point site:sap.com ... The number you see in debug doesn't mean the actual number, the number of decimals is adjusted in the display depending on the currency code.
View Entire Topic
tushantbhatia
Discoverer
0 Kudos

While working on a similar requirement to multiply numbers, i too found this strange, however i found a solution that while multiplying we need to divide this number by 10,100 or 1000 depending on the number of decimals that we have in amount.
for 1 decimal point we can divide by 10,
for 2 decimal point we can divide by 100,
and so on...

Sandra_Rossi
Active Contributor
0 Kudos
Very bad solution. Don't divide by 10, 100, etc. It's done automatically by ABAP language with CURRENCY word. Search the forum and read the ABAP documentation.