Code action DI013
(Improvement) Use division instead of DIVIDE
Description
When the 2nd argument of DIVIDE
is a non-zero constant, it is more efficient to use the division operator.
Example
Change:
DIVIDE([Total Sales], 1.25)
To:
[Total Cost] / 1.25
Why is Tabular Editor suggesting this?
The DIVIDE
function is a robust way to handle division by zero errors, as it returns a specific value or (Blank) if the denominator is zero. However, when the denominator is guaranteed to be non-zero, such as when dividing by a (non-zero) constant, the division operator /
is more efficient and easier to read. By using the division operator, the code becomes more concise and easier to understand.