Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 668 Bytes

File metadata and controls

28 lines (21 loc) · 668 Bytes
description
Converts a string into a number (double) in the specified format.

TO_NUMBER

Syntax

TO_NUMBER(expression varchar, format varchar) → double

  • expression: String to convert to a number.
  • format: Format for number conversion.

Examples

{% code title="TO_NUMBER example" %}

SELECT TO_NUMBER('12374.0023', '#####.###')
-- 12374.002

{% endcode %}

{% code title="TO_NUMBER example" %}

SELECT TO_NUMBER('12374', '#####')
-- 12374.0

{% endcode %}