In Oracle, the number type data to_char () is displayed as 0 less, or the value is,
Problem description:
When the to_char () function is used in Oracle, when the number value is a decimal number, it is often not displayed for a single digit 0.
For example, select to_char (0.02) from dual, and the result is. 02.
Improved to select to_char (0.02, 'fm0. 100') from dual, and found that the number of digits is 0.
Of course, there is still a problem here. When the parameter is 'fm0. 100', if the value is greater than two digits or the decimal point is greater than four digits, the conversion will be wrong ,:
I didn't think of a good way to add 9, for example, select to_char (11.2321212, 'fm9999990. 99999999 ') from dual, generally the conversion should not report an error, but I don't think this is the best way. It's too stupid to know if there is any better way. This to_char () the function is really cool. By default, when there is no parameter, it is as good as toString (). As for FM, just remove it and add it for execution, after comparing the results, we can see its role.