Dear all,
here is an interesting challenge. I am trying to get a decimal number as a text format in an xml file template without any thousands separator and a period as the decimal separator: xxxx.xx
In my locale, decimals appear with a space for thousands separator and a comma for decimal separator so here’s what I get when I simply use <<[Amount]>> : x xxx,xx
So following the advice from esteemed members of this community, I used this expression to replace both the space and the comma:
<<SUBSTITUTE(SUBSTITUTE(TEXT([Amount]),",",".")," ","")>>
However, it doesn’t work: I get x.xxx.xx and I don’t know why this first period appears there. I suspect that the thousand separator is not a true “space” but maybe a “no break space”, which I can’t copy in the expression.
So I tried something else:
<<FLOOR([Amount])&"."&RIGHT(TEXT([Amount]-FLOOR([Amount])),2)>>
It works, but it is rather convoluted. Especially now that I need to replace [Amount] by a SUM(), which will need to be calculated three times!
Any suggestions ?
Thanks
G