on 05-17-2021 11:37 AM
Hello,
in division operation result, the decimals digits are truncated to 6, even if I set a scale of 10.
For example :
select to_decimal(1/14, 28,10) from dummy; --> it s truncated to 6 digits (0,071428)
select to_decimal(3.14159265358979,28,10) from dummy; --> it displays 10 decimals as required.
Hello, I found that the scale in a division result is given by this rule:
scale = max(6, NumeratorScale + DenominatorPrecision + 1)
In the above example:
select 1/to_decimal(14,28,10) from dummy;
Source:
https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.04/en-US/20a380977519101494ceddd944...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ilaria,
when you need more precision, you can change the denominator precision before the division:
select to_decimal(1) / to_decimal(6) from dummy;
Regards,
Jörg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
7 | |
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.