String to number

sam2929
sam2929 used Ask the Experts™
on
Converting varchar(7 byte) 000.000
To_number(column,999.999) it gives me 0
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Software Developer
Commented:
As it should. The numeric value of string "000.000" is, in fact, zero. What result were you expecting other than zero?
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
Oracle doesn't show insignificant digits.

If you want to force a format, you need to use TO_CHAR and provide the format mask.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial