Skip to content

Commit

Permalink
Make cents_to_dollars bq friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenwindflower committed Mar 28, 2024
1 parent b2423fc commit 16c38bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macros/cents_to_dollars.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{# A basic example for a project-wide macro to cast a column uniformly #}

{% macro cents_to_dollars(column_name, precision=2) -%}
({{ column_name }} / 100)::numeric(16, {{ precision }})
(cast({{ column_name }} / 100) as numeric(16, {{ precision }})
{%- endmacro %}

0 comments on commit 16c38bb

Please sign in to comment.