TO_NUMBER
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
{{< codeheader "TO_NUMBER example" >}}
SELECT TO_NUMBER('12374.0023', '#####.###')
-- 12374.002
{{< codeheader "TO_NUMBER example" >}}
SELECT TO_NUMBER('12374', '#####')
-- 12374.0