For pdflatex usage there are least two packages that define the "intelligent" comma, icomma.sty and ncccomma.sty, that understand the role that the comma is playing in math mode, so that you can write, for example (the equivalent in another language than English) "the number $e=2,618\dots$ is the base of natural logarithms" and there is no ordinary punctuation space after the comma, as it would happen if the same thing is typeset while English is the current language.
I haven't done any testing to see check how those packages interact with unicode-math but I think it would make sense to roll that functionality into unicode-math itself.
From Claudio via email:
I haven't done any testing to see check how those packages interact with
unicode-math
but I think it would make sense to roll that functionality intounicode-math
itself.