Now I will answer my question. When using the TO_NUMBER
function TO_NUMBER
I missed the important point that everything I get from the TO_NUMBER
function will be a number. And the number contains nothing but a decimal point and E scientific notation. So 17,788.99 is actually not a number, but rather a string representation of 17788.99.
If we try to subtract 500 from 17,788.99, we will fail. (Well, Oracle implicitly converts numeric strings to numbers and vice versa, but basically we cannot perform arithmetic between strings and numbers). I am sure that the TO_NUMBER
function TO_NUMBER
almost never used to select a column value. It was rather used to perform arithmetic operations. Instead, we use TO_CHAR
to display the column value or any numeric expression in a neat, easy-to-read format. The fomat and nls_params models are designed not only for the TO_NUMBER
function, but also for TO_CHAR
.
source share