Forum Discussion

444456464's avatar
444456464
Copper Contributor
Feb 24, 2022

Show % symbol

Hello,
I have a question. The columns I circled on my Sharepoint list are Number type columns and I checked the "percentage" box in the list settings.
I would like to be able to display the % symbol behind the numbers that are in my columns. Is it possible ?

Thank you in advance for your help !

 

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    444456464 yes it's possible with a bit of JSON column formatting:

     

    The JSON is as follows and it's the txtContent line that's important here:

     

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
      "elmType": "div",
      "txtContent": "=toString(@currentField * 100) + '%'",
      "style": {
        "border": "none",
        "padding-left": "14px",
        "background-color": "=if(@currentField <= 0.1,'#468259', if(@currentField > 0.1 && @currentField <= 0.5,'#d8a810', '#c00000'))",
        "color": "white"
      }
    }

     

     

    Rob
    Los Gallardos
    Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

      • RobElliott's avatar
        RobElliott
        Silver Contributor
        So just change the txtContent to what I gave you and add in the background color if you need it, or don't add it if you dont.
    • RobElliott's avatar
      RobElliott
      Silver Contributor
      As you will realise, the numbers need to be between 0.0 and 1.0.

Resources