Jan 14 2022 07:14 AM
Hi,
I have a list which has a column with scores in which is set to 2 decimal places, this column is populated with a Flow.
I would like all values to be formatted as 00.00%. How do I format in a '%' symbol after each value submitted into the column? I have tried going into the advanced mode in conditional formatting, but cannot get it to work.
Thank you for your time!
Jan 15 2022 02:09 AM - edited Jan 15 2022 02:10 AM
Solution@Tom2595 the JSON for adding a % symbol to each item in the column is:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=@currentField + '%'"
}
What you will notice is that the JSON ignores the decimal place setting for the column, and if the column has a value like 14.20% it will drop the 0 and display just 14.2%. It's fine if the value is 8.75% for example. I've not yet found a good way to force it to display the trailing 0.
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
Jan 17 2022 03:53 AM - edited Jan 17 2022 03:54 AM
Hi Rob - I added the "=@currentField + '%'" into the JSON I had for conditional formatting. I had some numbers in there which were being populated through a Flow which went to quite a few decimal places. To rectify this I added a number formatting step into the Flow to ensure the input always had a maximum of 2 decimal places. Thank you very much for your help!
Jan 17 2022 04:48 AM
@Tom2595 @RobElliott Great way of using JSON formatting to achieve such requirements. I like JSON formatting capabilities in SharePoint online.
Also, if you are using a column of data type Number, you can try this SharePoint OOTB setting to append % to number column:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.