1. The origin of the problem
When the Oracle database field value is less than 1 decimals, processing with char type loses 0 of the preceding decimal point
For example, 0.2 becomes. 2
2. Workaround: (1) format the digital display with the TO_CHAR function
Select To_char (0.338, ' fm9999999990.00 ') from dual;
Results: 0.34
The focus here is to see the fm9999999999.99, which means that the integer part is up to 10 bits, the fractional part is 2 bits, and the FM indicates that the space before the transpose string is removed, and there are spaces before the fm,0.34. (2) If the Decode function is less than 1, the first digit must be '. ', then judge whether the first is '. ', then add ' 0 ' to the front to sql> Select Decode (substr (num,1,1), '. ', ' 0 ' | | Num,num) from T1_number DECODE (SUBSTR (num,1,1), '. ', ' 0 ' | | Num,num)
Oracle 0 missing points before the decimal point