Select To_char (0.1) nums from dual;
It is observed that if the integer digits of the decimal are 0, the converted string does not have the preceding 0, and if the preceding 0 is required, a certain rule is required to format it, as shown below
Select To_char (0.1, ' 0.9 ') nums from dual;
We change the decimal number to an integer and then we look.
Select To_char (1, ' 0.9 ') nums from dual;
Integers can also be programmed with double types
There are many rules about To_char (x, y) and Y, here is an unknown solution, if you want integers or integers, decimals or decimals, you can try the following method, with replace
The reference examples are as follows:
Select Unitname,hurk,ldrk,replace (b, ':. ', ': 0. ') scale,rdate from (select Unitname,hurk,ldrk,concat (' 1: ', round (Hurk/ ldrk,2)) B,rdate from Dynamicpeople)
Oracle questions about number type conversion To_char types