Scenario: I am calling a function that returns a field that the user enters in. The field usually returns a number like '120000' which I then use to_char to convert into '120,000'.
Problem: Some users enter in values such as '120,000' which gives me an error when trying to use to_char. Also the function will return a space ' ' if no value is found. I tried something with to_number earlier and it has a problem with the ' ' I believe.
Question: What would be the best way to handle this problem? Case statement checking for the ','? Using to_number then to_char?
Note: I can hack a solution together I'm just wondering what the best way to handle this is.