I really like to have a small space between a number (X) and a % sign, and never the percent sign on a new line. So usually I type X~\%. However, the distance generated this way is to large for me? Is there any way to consistently reduce it? Thank you!
This is my MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
x~%. %too much horizontal space
x%. % too few horizontal space
\end{document}

\,\%. On the other hand, usually no space is added. – egreg Jan 24 '23 at 17:53\,is nonbreaking, see here – Willoughby Jan 24 '23 at 17:54