Categories: Conversion
TO_NUMBER
Converts a string into a number (double) in the specified format.
Syntax
TO_NUMBER(expression varchar, format varchar) → double
- expression: String to convert to a number.
- format: Format for number conversion.
Examples
TO_NUMBER exampleSELECT TO_NUMBER('12374.0023', '#####.###')
-- 12374.002
SELECT TO_NUMBER('12374', '#####')
-- 12374.0