In Oracle, if the absolute value is less than 1 decimal, only the value after the decimal point is displayed, and 0 in front of the decimal point is ignored, for example: 0.1 is displayed as. 1 in Oracle.
How to resolve this type of problem:
x=0.2
To_char (' fm9999990.9999 ', x) output value is 0.2
But now there is a problem, if it is x=10, then the display will be 10. , in the back will be a small number of points, so it is not good to see, how to display the actual input, on the Internet to find another Oracle character processing function RTrim, so now these changes can be as follows:
X =10
RTRIM (To_char (' fm9999990.9999′,x), '. ') →10
After this has been processed, if the integer is displayed correctly as an integer, the decimal number is displayed with the 4-bit precision reserved.
Scenario Two:
In addition, the following methods can be processed:
Select
DECODE (TRUNC (:d ecimal_number),
REPLACE (to_char (:d ecimal_number), '. ','to_char(:d ecimal_number)
)
from dual;
How decimals with an absolute value less than 1 in Oracle displays the 0 in front of the decimal point