  Suppose that $p$ is an odd prime and $g>1$ is a primitive root modulo $p$.
Let $M$ be a number field contained in the $p$-th cyclotomic field. Girstmair
found a surprising relation between the relative class number of $M$ and the
digits of $1/p$ in base $g$. In this paper, we consider an analogue of
Girstmair's formula in function fields. Suppose that $P \in \mathbb{F}_q[T]$ is
monic irreducible and $G \in \mathbb{F}_q[T]$ is a primitive root modulo $P$.
Let $L$ be an extension field of $\mathbb{F}_q(T)$ contained in the $P$-th
cyclotomic function field. The goal of this paper is to give relations between
the plus and minus parts of the divisor class number of $L$ and the digits of
$1/P$ in base $G$.
