Adding "0" after decimal in Oracle

I want to add a finite number '0' to the number when I execute a Select query:

i want to choose

344.89 as 344.890

123213.45 as 123213.450

1.2 as 1.200

I tried using to_char(col_name,'000000.000') , but this led to the fact that

344.89 => 000344.890

123213.45 => 123213.450

1.2 => 000001.200

added to the result is "0".

+4
source share
1 answer

You are close to to_char format. Try the following:

 to_char(col_name,'999999.000') 

9 are optional seat holders. Element 0 is an input to leading zeros.

+8
source

Source: https://habr.com/ru/post/1499380/


All Articles