Trailing Zeros for decimal (12,2) on redshift query editor.

0

I could not find any official AWS documentation that specifically addresses the display of trailing zeros for decimal values in the Redshift Query Editor. However, based on my testing and experience, it seems that the Query Editor does not display trailing zeros for decimal values by default. My reporting layer requires price based on columns with 2 point precision. However, the trailing zeros aren't available. Is there a way to save them as e.g. 21.00, 10.20?

feita há um ano917 visualizações
1 Resposta
3

Start with TO_CHAR function to format

https://docs.aws.amazon.com/redshift/latest/dg/r_TO_CHAR.html and https://docs.aws.amazon.com/redshift/latest/dg/r_Numeric_formating.html

and the following example can help you

SELECT TO_CHAR(your_decimal_column, 'FM9999999990.00') AS formatted_decimal
FROM your_table;
profile picture
ESPECIALISTA
respondido há um ano
  • Hi @sdtslmn thanks so much for responding! We need the data to be in decimal for calculations. Is that not possible?

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas