Feature Request: Decimal Truncation and Remainder Functions #16560
williamkaper
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Since DuckDB already has |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We do a lot of accounting calculations that require high precision. Numeric/decimal types wind up rounding when you try to cast to a specific precision instead of truncating. There aren't any ways to do high precision truncating/remaindering on decimals, so we created a set of Macros to do it for us, but it would be faster if this logic (or even more performant logic) was in C as a supported native function for DuckDB.
MACROS (the first is a helper to convert e-notation to its high precision normalized string equivalent in base 10 format)
These are tests we wrote in DBT for these Macros:
Beta Was this translation helpful? Give feedback.
All reactions