How can I use commas to separate thousands for numbers with five or more digits (not four digits) in the map in QGIS, e.g., “10000” should be “10,000” in the annotation. To clarify, the region in question is located in Tunisia. Regarding the annotations in the grid, not the attribute table field names, I would like the coordinates to be displayed as "560,000" instead of "56,000" in my figure.
2 Answers
I think this is a region-related setting. You could try changing the region or formatting your number as a string (we need more context to see where the number is located on the map).
Here is how you can do it with Field Calculator:
format_number(10000, 2, 'eng')
if(length("name of your column")>4,format_number("name of your column",language:='en'),format_number("name of your column",omit_group_separators:=true)
First you need to check, whether your field has more than four digits. This is the length()
part of the expression. If there are more than four digits, the language:='en'
forces the use of commas as thousands separator. If not, omit_group_separators:=true
disables the separator.
For more details, see the documentation entry on format_number()
.