  The number-theoretic codes are a class of codes defined by single or multiple
congruences. These codes are mainly used for correcting insertion and deletion
errors, and for correcting asymmetric errors. This paper presents a formula for
a generalization of the complete weight enumerator for the number-theoretic
codes. This formula allows us to derive the weight enumerators and
cardinalities for the number-theoretic codes. As a special case, this paper
provides the Hamming weight enumerators and cardinalities of the non-binary
Tenengolts' codes, correcting single insertion or deletion. Moreover, we show
that the formula deduces the MacWilliams identity for the linear codes over the
ring of integers modulo $r$.
