At first I thought you were doing this in a nanoflow. Aparently not. But this part of the doc tells you that it indeed will not function were you are trying it:
Hello! I was in kinda of the same picle, I couldnt’t use the text box because it was a text made using expressions. So this was my solution, string functions!
First, you format the decimal to string using formatDecimal. This will work anywhere, but it will just format to a string with no special formatting.
We will need to check if the decimal is in fact a decimal and has a point, we do that by using the find function, we pass our formated string and the “.” point parameter, and we check if it doesn’t exist, if it doesn’t, the function will return -1, we just check if that is the case and we just return the number which won’t have any digits after the point because it doesn’t have a point.
But if that isn’t the case and there is a point, we will need to know where that point is using the same find function, then we just take that value into a substring function to get that part of the string, but we don’t want the numbers just to the point character, so we add a +3 to get two digits after the point, you can increase this number if you want more precision :)
if find(formatDecimal($DecimalNumber), '.') = -1 then formatDecimal($DecimalNumber)
else
substring(formatDecimal($DecimalNumber),0, find(formatDecimal($DecimalNumber), '.')+3)
And then you can format and add “,” and “.” by checking the lenght of the string and adding to the string