This is related to How to use \pageref{foo} as a number? but slightly different:
\documentclass{scrreprt}
\usepackage{blindtext}
\renewcommand*\thepage{A\arabic{page}}
%This type of pagenumbering is required by the customer
\begin{document}
This document consist of \pageref{LastPage} pages.\\
%Needed in this case: "This document consist of 4 pages."
%(Length of document varies each time of course)
\blindtext[15]
\label{LastPage}
\end{document}
I need a way to convert e.g. "A4" into "4" without breaking the format of the pagenumbering in the document. I tried to use \StrSubstitute but it failed, because it does attempt to replace something in the \pageref command instead doing the operation with its value "A4". I also tried every proposed solution in How to use \pageref{foo} as a number? but without success.
How would you tackle this problem? I don't seem to understand correctly how to read the value from \pageref and work with it (i.e. eliminate the "A" with \StrSubstitute).
Any help would be greatly appreciated. Thanks a lot!
