\fpeval doesn't like decimal numbers with commas as separator:
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{siunitx,xfp}
\sisetup{locale=DE}
\begin{document}
\num{1.5}
\num{1,5}
\num{\fpeval{1.5+1.4 + max(1.5 , 2 )}}
\num{\fpeval{1,5+1,4 + max(1,5 , 2 )}} %error
\num{\fpeval{1,5+1.4}} %error
\end{document}
This gives
! Undefined control sequence.
<argument> \LaTeX3 error:
Unexpected comma: extra arguments ignored.
As a german I'm rather used to commas (and other germans too) and so I constantly have to correct my input. Is there an expandable way to get this working?
The difficulty is naturally that the comma is used in the \fpeval syntax, e.g. for max. I would accept the requirement to use spaces here, or to use another symbol e.g. ;, or to use some protection command like \dontsanitize{max(1.5,2)}, or max(1,5 \realcomma 2).
\sanitize{1,5}. In any case I really don't understand the use of commas, I understand that one wants the output to be a comma (that's okey) but in the input, I think it's absolutely better to use a dot. Other programming languages use that, plus there's no doubt of what you wrote inmax(1,5,2)(which is what is read inside\ExplSyntax(On|Off)). In any case, may be it could be changed the syntax tomax(1,2;2)but I don't know the internals. – Manuel May 30 '17 at 10:11fpmodule use either commas or periods for the decimal separator and a semicolon for separating arguments, but I wouldn't dare asking Bruno to implement it. Having a standard syntax for numeric fp expressions is much better. – egreg May 30 '17 at 11:59fpdirectly. I would prefer an (expandable) command that I can inject if needed (and it would be okay if replace all commas by dots, the max-case seldom occur in the wild ...) – Ulrike Fischer May 30 '17 at 12:43