I am having some issues to convert what appears to be unicode into number. I am running a python script from a exec module where the msg.payload returns a value which seems to be unicode(?)
Julian is correct that you would need to get rid of the trailing newline character -- but the embedded comma is still going to cause the conversion to fail...
If you know that the payload will only contain a formatted number string, you could use: $replace(payload, /\D/, "").$number()
This strips out all of the non-digit characters (including newlines) and then tries to convert the remaining digits to a number.
But in general, it would be best to modify the python code to return a valid number (unformatted) without any whitespace or line breaks...
Ah, your eyesight (or monitor) is obviously better than mine as I completely missed that!
I guess that could be a locale issue though since many European languages swap what we would call "normal" - e.g. "2,163,000.45" becomes "2.163.000,45"