\documentclass[english,ngerman]{tudscrartcl}% andere Klassen möglich
\usepackage{iftex}
\iftutex
  \usepackage{fontspec}
\else
  \usepackage[T1]{fontenc}
  \usepackage[ngerman=ngerman-x-latest]{hyphsubst}
\fi
\usepackage{babel}
\usepackage{microtype}

\usepackage{mathswap}
\begin{document}

\mathswapoff
\(4.523,58\)
\mathswapon

\(4.523,58\)
\(4,523.58\)

\begingroup
  \commaswap{\,}
  \dotswap{,}
  \(4,523.58\)
\endgroup

\begingroup
  \selectlanguage{english}%
  \(4,523.58\)\newline
  \(4.523,58\)
\endgroup

\begingroup
  \selectlanguage{english}%
  \commaswap{.}
  \dotswap{\,}
  \(4.523,58\)
\endgroup

\end{document}

