TO_NUMBER

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Description

Converts an input expression to a fixed-point number. For NULL input, the output is NULL.

Arguments

Required:

&#xNAN;<expr>

An expression of a numeric, character, or variant type.

Optional:

<format>

The SQL format model used to parse the input expr and return. For more information, see SQL Format Models.

<precision>

The maximal number of decimal digits in the resulting number; from 1 to 38. In Snowflake, precision is not used for determination of the number of bytes needed to store the number and does not have any effect on efficiency, so the default is the maximum (38).

<scale>

The number of fractional decimal digits (from 0 to precision - 1). 0 indicates no fractional digits (i.e. an integer number). The default scale is 0.

Returns

The function returns NUMBER(precision,`` ``scale).

  • If the precision is not specified, then it defaults to 38.

  • If the scale is not specified, then it defaults to 0.

To more information check the TO_NUMBER in snowflake documentation.

Recommendations

  • No additional user actions are required.

  • If you need more support, you can email us at [email protected].

  1. SSC-EWI-OR0045: Cast type L and FML are not supported.

  2. SSC-EWI-OR0050: Input Expression is out of the range.

  3. SSC-EWI-OR0053: Incorrect input format.

Last updated