Lets call MaxDigitWidth $M$, CharWidth $C$ and Pixels $P$. I assume $M,C,P\geq 0$ so that truncation is just rounding down.
Your formula amounts to $100C = \left\lfloor100\frac{P-5}{M}+\frac{1}{2}\right\rfloor$, that is $100C\leq 100\frac{P-5}{M}+\frac{1}{2} < 100C+1$ or $C-\frac{1}{200}\leq\frac{P-5}{M}
If $C\geq 1$ we have $\frac{200P-1000}{200C-1}\geq M>\frac{200P-1000}{200C+1}$. If a solution exists, then $M = \left\lfloor\frac{200P-1000}{200C-1}\right\rfloor$ is a solution.
Note though that there might not be any solution or there might be more than one depending on $P$ and $C$.