1

Following a tutorial: SharePoint modern view formatting with JSON
I realized that formatting a column with numeric or currency values are shown like strings. In this case I have the "Price" column with a Currency value format, it's supposed to be showed like this (notice is separated with commas):

enter image description here

but after the JSON formatting, it is shown like this:

enter image description here

I want the values to be comma separated. This is the JSON part where I use the "Price" value:

{
    "elmType": "span",
    "txtContent": "Price",
    "style": {
      "display": "block",
      "padding-top": "20px"
    },
    "attributes": {
      "class": "ms-fontSize-l ms-fontWeight-semibold ms-fontColor-neutralPrimary"
    }
},
{
    "elmType": "span",
    "txtContent": "='$' +[$Price]",
    "style": {
      "display": "block"
    }
},

How can I make the value to be shown as numeric (with commas) and not like a string?
Thanks in advance!

  • There is no built-in function currently to apply a number format. You might be able to do some trickery by converting it toString, then looping through the "characters" and inserting a comma every every third character, but that sounds painful just to format the number – willman Jan 13 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.