A one-dimensional local length formula
Let $A$ be a one-dimensional commutative Noetherian local ring, $M$ a finite $A$-module, and $x\in A$. If $M/xM$ has finite length, then $\ker(x:M\to M)$ has finite length and $$\ell_A(M/xM)=\ell_A\ker(x:M\to M)+\sum_{\substack{\mathfrak p\in\operatorname{Spec}A\\ \dim(A/\mathfrak p)=1}}\ell_{A_{\mathfrak p}}(M_{\mathfrak p})\,o_{\mathfrak p}(x).$$
Here $o_{\mathfrak p}(x)=\ell_{A/\mathfrak p}((A/\mathfrak p)/x(A/\mathfrak p))$. Lengths take values in $\mathbb N\cup\{\infty\}$, and the sum is the finite sum over the nonzero summands when there are finitely many, and is assigned zero otherwise.