SharePoint Online – By Heba Hegab
SharePoint list is the most widely used to store data. They have different types of data in order to help storing the data in correct format. Numeric data types has special format to display big numbers by using thousand separator, So, if you have a numeric column or calculated field with output numeric will suffer from this issue.
If you create column from list as numeric data type, you will have the option to remove the separator. But if you are adding from the site settings you won’t have this option.
Also, calculated field doesn’t have this option. So, you will need another way to solve this issue.
Now to create calculated field and remove the comma separator, we are going to use JSON to remove it. In the column settings, go to column validation and paste the following code
{“$schema”:”https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json”,”elmType”:”div”,”attributes”:{“class”:”=if(@currentField > 0,”, ”)”},
“children”:[{
“elmType”:”span”,”style”:{“display”:”inline-block”}},{“elmType”:”span”,”txtContent”:”@currentField”}
]}