Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SharePoint Column whose datatype is number & selected option show as percentage it's value is not displaying in percentage(%) in the gridview

$
0
0

Dears,

I have an SPList. This list has few columns. I have one column name PercentageCompletion whose datatype is number and selecting option show as percentage. Below screenshots display how I am creating PercentageCompletion column.

When Item creates into SPList then PercentageCompletion value is coming as expected. Refer below screenshots.

Now my requirement is I am displaying SPList item into the gridview but this PercentageCompletion data is not coming as expected like (50%,100%). Instead of 50% it is coming 0.5 and Instead of 100% it is coming 1. You can see in the below screenshots.

I am using below code to get the result expected like 50%,100%,.. but it's not working.

I tried many option for DataFormatString but no luck.

<asp:BoundField HeaderText="% Completion" DataField="% Completion" DataFormatString="{0:P}"/>

Please help me to fix this issue.

Thanks & Regards,

Masroor


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>