# `2.25 cookie²`</code></pre><p>The main reason you would use a custom quantity is if you want to change built-in behavior, or maybe have special methods for different types of quantities.</p><p>Note that you can declare a method on <code>AbstractQuantity</code>, or <code>AbstractGenericQuantity</code> to allow their respective inputs.</p><p><strong>Note</strong>: In general, you should probably specialize on <code>UnionAbstractQuantity</code> which is the union of these two abstract quantities, <em>as well as any other future abstract quantity types</em>, such as the planned <code>AbstractRealQuantity</code>.</p><pre><code class="language-julia hljs">function my_func(x::UnionAbstractQuantity{T,D}) where {T,D}
0 commit comments