Does function round() honour decimal points?

I’m trying to create a calculations that depending on other factors it either takes a numerical value from one column or a percentage from another.

Now getting them back to proper format has been a struggle. I can’t find anything like string_format or number_format that would return a string.

At least for percentages I was hoping to use concat(round(${value} * 100, 2), "%") but for full numbers I’m still getting 7% instead of 7.00%

Any idea why?

Hi @Dawid_Nawrot, Strange :wink: your query works fine in mysql giving proper result while in snowflake its wrong. I tried to_decimal it works in snowflake DWH. You can also check try this if supported in your environment.
link - https://docs.snowflake.net/manuals/sql-reference/functions/to_decimal.html

select concat(to_decimal((0.7 * 100), 9,2), ‘%’)

Hmm the rounding is not done in SQL though because it’s a table calculation, which points me into client-side direction, aka JavaScript