Question

I am looking for a JSON query to format Currency column in SharePoint Online. Below query works but removes currency icon from the value.

{
  "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
  "elmType": "div",
  "style": {
    "font-weight": "bold",
    "background-color": "yellow"
  },
  "txtContent": "@currentField"
}

No correct solution

OTHER TIPS

What is the type of your field on which you are adding this JSON?

Currently Column/JSON Formatting will support only following column types:

Supported column types:

The following column types support column formatting:

  • Single line of text
  • Number
  • Choice
  • Person or Group
  • Yes/No
  • Hyperlink
  • Picture
  • Date/Time
  • Lookup
  • Title (in Lists)

The following are not currently supported:

  • Managed Metadata

  • Filename (in Document Libraries)

  • Calculated

  • Retention Label

  • Currency

Reference:

  1. Use column formatting to customize SharePoint.

Work Around:

If you want to concatenate currency symbol to numeric columns then you can use below JSON:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "font-weight": "bold",
    "background-color": "yellow"
  },
  "children": [
    {
      "elmType": "span",
      "txtContent": "$",
      "style": {
        "display": "inline-block",
        "padding": "0 1px"
      }
    },
    {
      "elmType": "span",
      "txtContent": "@currentField"
    }
  ]
}

Reference:

Concatenate Currency Symbol to Numeric Columns.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top