Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
4.4k views
in SharePoint Online by 1 2 3

In SharePoint Online, I have a column number and I need to create a JSON column formatting with a conditional background. But I had noticed that the JSON column formatting removes the thousands separator from a number and it doesn't display the comma separator for long number Ex: 50,000 show it as 50000.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
"txtContent": "@currentField",
  "style": {
    "background-color": "=if(@currentField < 1000,'Orange', 'Yellow')"
  }
}

No Thousand Separator in JSON Column Formatting

Thousand Separator in JSON Column Formatting

My question is How to apply JSON column formatting without removing Thousand Separator in SharePoint Online?


1 Answer

1 like 0 dislike
by 159 200 385
selected by
 
Best answer

How to display Thousand Separator in SharePoint JSON Column Formatting?

In SharePoint Online / 2019, The JSON Column Formatting removes the thousand separators (comma) even if you have set the number of decimal places in the SharePoint Number column settings.

number of decimal places in JSON column formatting

So, in JSON Column Formatting, you can't format the number column to show the thousand separator! Instead, you should use a calculated column and apply the same JSON Column Formatting on the newly created SharePoint calculated column.

Steps

  1. in Your SharePoint List, Create a new calculated column.
  2. In the calculated column formula add the below formula

     =TEXT(Your Number Column,"#,###")
    
  3. In the same column setting page, at the Column Formatting, paste the same JSON Column Formatting.
    create a calculated column thousand format with JSON Column Formatting in SharePoint Online
  4. Save your changes > Go back to the list.
  5. Great, your JSON Column Formatting with displaying thousand separator for Number column.

Number Thousand format in JSON Column Formatting


See Also

If you don’t ask, the answer is always NO!
...