INSERT_CURRENCY_UDF

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.

Definition

Insert the specified currency text at the given position in the number, or before the first digit to avoid leaving blanks or the number sign between the currency and the number.

PUBLIC.INSERT_CURRENCY_UDF(INPUT VARCHAR, CURRENCYINDEX INTEGER, CURRENCYVALUE VARCHAR)

Parameters

INPUT VARCHAR

The result of the TO_CHAR(Numeric) that needs the currency inserted.

CURRENCYINDEX INTEGER

The index to insert the currency at.

CURRENCYVALUE VARCHAR

The text that will be inserted as currency.

Returns

A varchar which has the currency text at a specific position.

Usage example

Input:

SELECT PUBLIC.INSERT_CURRENCY_UDF(to_char(823, 'S999999'), '1', 'CRC');

Output:

'+CRC823'

Last updated