My question is whether or not the tostring command is locale specific. If the locale specifies commas as the decimal and periods as the separator will tostring do the the right thing?
It might better if the option was tostring(
Where can I configure "commas" as "locale specific" ??
My browser settings ? Just checked on both Safari (Mac OS X) and Chrome and nothing like that it's there ...
Any pointers ?
It's based on your browser settings.
Yes, it might be better. But the "commas" operator is locale specific.
[Update] I am wrong. After believing this for a long time, I was chagrined to find that it is untrue. The commas
operator of the tostring
command inserts commas. Always.
@sowings has a solution:
searchstring
| stats count
| eval count=tostring(count,"commas:)
| rex field=count mode=sed "s/,/./g"
Actually that isn't complete. This would show 1234.56 as 1.234.56 when it is expected to see 1.234,56
Add an extra 2 lines to fix it.
| eval count=tostring(count,"commas")
| rex field=count mode=sed "s/\./#/g"
| rex field=count mode=sed "s/,/./g"
| rex field=count mode=sed "s/#/,/g"
make it into a macro if you need it a lot.
And my apologies for not coming back to this answer and fixing it sooner.
Does not seem to be in my Swiss German settings
So the "commas" operator will do the right thing?