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)
444456464
Feb 25, 2022Copper Contributor
Thank you ! But I have already this in my column formatting : {
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if(@currentField >[$Tauxoccupationmaximal] , 'red', if(@currentField <[$Tauxoccupationmaximal], 'green' , 'orange')"
}
}
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if(@currentField >[$Tauxoccupationmaximal] , 'red', if(@currentField <[$Tauxoccupationmaximal], 'green' , 'orange')"
}
}
- RobElliottFeb 25, 2022Silver ContributorSo 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.