v.22.12New Feature

Added multiplyDecimal and divideDecimal functions for fixed precision decimal operations

Added multiplyDecimal and divideDecimal functions for decimal operations with fixed precision. #42438 (Andrey Zvonov).
Added multiplyDecimal and divideDecimal functions to perform decimal arithmetic operations with fixed precision in ClickHouse.

Why it matters

These functions provide precise multiplication and division for decimal data types, addressing issues with precision loss in decimal arithmetic and enabling accurate financial and scientific calculations.

How to use it

Use the new functions in your SQL queries as follows:

SELECT multiplyDecimal(decimal_column1, decimal_column2) FROM table;
SELECT divideDecimal(decimal_column1, decimal_column2) FROM table;

These functions ensure the result maintains fixed decimal precision automatically.