cancel
Showing results for 
Search instead for 
Did you mean: 

to_decimal_ext function

Former Member
0 Kudos

Hi All,

Referrence guide page:950 shows to_decimal_ext('99,567.99', '.', ',',38,3) = 99567.990.

How?

Please explain.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Its including precision as a parameter. Here the precision is 3, hence 990.

Former Member
0 Kudos

Hi Arun Kumar,

Thanks for the reply. I got your point. But confusion part is value 38. Why it is mentioned?

Please help me.

venkataramana_paidi
Contributor
0 Kudos

Hi Kiwi,

To_decimal_ext syntax as per the reference guide as shown below.

to_decimal_ext(<in_str, decimal_sep, thousand_sep, precision, scale>)

Your input :

to_decimal_ext('99,567.99', '.', ',',38,3)

in_str= 99,567.99

decimal_sep=.

Thousand_sep=,

precision=38

Scale=3

Scale means , after decimal point(.) number of digits .

In our example we have given scale as 3 but input we have only 2 only . That's why it is converted as 990.

If it is 4 then it will convert as 9900.

Here we have 38 is precision means no of digits in the decimal string . It includes before decimal point(.) and after decimal point.  It is maximum count of digits in the input except decimal point. As per input we can have 38 digits in the decimal string except decimal value.

I hope you understand .

Thanks & Regards,

Ramana.

Former Member
0 Kudos

Hi,

38 is a number actually called precision of a decimal datatype. If i am not wrong, anything above 28 is for Oracle. if your database is not oracle you don't have to worry anything above 28

Arun