diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 8cc4b27bd..02ddfcb7e 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -501,12 +501,12 @@ \subsection{Numeric Functions and Conversion Functions}\label{numeric-functions- \end{lstlisting}\end{synopsis} \begin{semantics} Convert a scalar non-\lstinline!String! expression to a \lstinline!String! representation. -The first argument may be a \lstinline!Boolean! $b$, an \lstinline!Integer! $i$, a \lstinline!Real! $r$ or an enumeration value $e$ (\cref{type-conversion-of-enumeration-values-to-string-or-integer}). -The other arguments must use named arguments. -For \lstinline!Real! expressions the output shall be according to the Modelica grammar. - -The optional \lstinline!! are: +The first argument may be a \lstinline!Boolean! $b$, an \lstinline!Integer! $i$, a \lstinline!Real! $r$, or an enumeration value $e$ (\cref{type-conversion-of-enumeration-values-to-string-or-integer}). +The other arguments can only be passed as named arguments, and the recognized ones are: \begin{itemize} +\item + \lstinline!String format!: ANSI-C style format string, see below. + Only allowed for formatting of a \lstinline!Real! value, and must not be combined with other named arguments. \item \lstinline!Integer minimumLength = 0!: Minimum length of the resulting string. If necessary, the blank character is used to fill up unused space. @@ -514,8 +514,11 @@ \subsection{Numeric Functions and Conversion Functions}\label{numeric-functions- \lstinline!Boolean leftJustified = true!: If true, the converted result is left justified in the string; if false it is right justified in the string. \item \lstinline!Integer significantDigits = 6!: Number of significant digits in the result string. + Required when formatting a \lstinline!Real! value and \lstinline!format! is not provided. \end{itemize} +For \lstinline!Real! expressions the output shall be according to the Modelica grammar. + \begin{nonnormative} Examples of \lstinline!Real! values formatted with 6 significant digits: \emph{12.3456}, \emph{0.0123456}, \emph{12345600}, \emph{1.23456E-10}. \end{nonnormative}