Forum Discussion
444456464
Feb 24, 2022Copper Contributor
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 % symbo...
RobElliott
Feb 24, 2022Silver 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
Feb 24, 2022Silver Contributor
As you will realise, the numbers need to be between 0.0 and 1.0.