More in this section

Forums / General Discussions / Polls result box formatting

Polls result box formatting

2 posts, 0 answered
  1. Vangelis
    Vangelis avatar
    153 posts
    07 Jan 2006
    23 Jul 2007
    Link to this post

    Does anyone know where I can change the number format of poll results? I just want to display the number percent with 2 decimals (ex 16,67%) instead of ex 16,6666666666667%

    Best regards

  2. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    18 May 2013
    24 Jul 2007
    Link to this post
    Hello Vagelis,

    In the ~/Sitefinity/ControlTemplates/Polls/ResultsBoxNoLegend.ascx modify the percentage literal Text property to something like this:

    <asp:Literal runat="Server" ID="percentage" Text='<%# String.Format("{0:##.##}", DataBinder.Eval(Container.DataItem, "Percentage")) %>'>'></asp:Literal>

    I assume you are using the PollBox with this template as the percentage label is deprecated there.

    Best wishes,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered