We are displaying a grid with some fake data in it and we want to show the summary column as a percentage with a precision of 2 decimals places. We have the value showing up but how do I format the value to read:
-67.68%
Right now it omits the percent sign. I've tried the "rowDisplayLabel" but that is more of a prefixing. I tried different format values like "{0:P2}" but that didn't work either.
settings.ColumnSetting().ColumnKey("CompensationPercentageOver").AllowSummaries(true).SummaryOperands(x => { x.SummaryOperand().Type(SummaryFunction.Custom).Active(true).Format("{0:2}").RowDisplayLabel("").SummaryCalculator("calculateCompensationPercentageOver"); });
The column is setup as a normal column as a number.
For extra brownie points - is there any way to show specific values in a different color? Like negative values should be red while positive values should be in black. Thoughts?
I found the way.
Change the format in the summary settings to .Format("percent") and then in the calculation, I divide the value by 100 to offset the inherit calculation by 100.
Hello Karthik,
I am glad that you manager to achieve your requirement.
Please let me know if you need any further assistance with this matter.