How to align dotfill to the right

\leaders

If you need vertically aligned dots, then you need \leaders. It is also used by \@dottedtocline from the table of contents. There is a kind of invisible fixed grid of leader boxes (horizontal positions are fixed) and \leaders select the boxes whose width fits entirely in the wanted space.

  • (+) Vertical alignment.
  • (+) Overall equal distances between dots.
  • (−) A leader box with with w might not be shown if the space is smaller than 2 * w, depending on the horizontal position.

\cleaders

The leader boxes are tightly packed in the middle of the space, available space (smaller than the width of a leader box) is distributed at the left and right side. Example from "The TeXbook" with leader box of width 10pt and the available space of 56pt:

3pt box box box box box 3pt
  • (−) No vertical alignment of the leader boxes.
  • (+) Overall equal distances between dots.

\xleaders

The "extensible" leaders divides the available space in as many slots as possible and the leader boxes are put horizontally centered inside the slots. Example from "The TeXbook" with leader box of width 10pt and the available space of 56pt:

1pt box 1pt box 1pt box 1pt box 1pt box 1pt
  • (−) No vertical alignment of the leader boxes.
  • (−) Dot distances differ from one \xleader to another.
  • (+) Probably it looks best for single isolated instances.

Summary

If vertical alignment is needed (table of contents, nomenclature, ...), then \leaders is the right command.


Please always post complete documents so answers may be tested, but you are using \cleaders so the dots are centred between the boxed number and the (unshown) earlier text which means their position is irregular depending on that text. I suspect you want \leaders or \xleaders.