Is DataFormatString broken?

3 posts, 1 answers
  1. DuelingCats
    DuelingCats avatar
    49 posts
    Member since:
    Jul 2012

    Posted 03 Dec 2012 Link to this post

    I am setting a label DataFormatString for my line series and I noticed that it is not taking effect. The datasource I am providing to the chart contains a score as a double. I wanted to provide the {0:F} formatter so that I do not display unnecessarily long precision. 

    With the following markup:
    <LabelsAppearance DataFormatString="{0:F}">
        <TextStyle Bold="true" Color="#003366" />
    </LabelsAppearance>

    If the data is 56.1, the label is 56

    With this markup:
    <LabelsAppearance>
        <TextStyle Bold="true" Color="#003366" />
    </LabelsAppearance>

    If the data is 56.1, the label is 56.1

    Is my data format string incorrect, or is it just not working?
  2. Answer
    Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 03 Dec 2012 Link to this post

    Hello,

    Indeed, the F format string is not working within RadHtmlChart in the current version of RadControls. This bug has already been logged in our PITS here, so that you can monitor its progress, comment and vote on it.

    For the time being you can use the N format string which has the same effect as F format string(e.g. DataFormatString="{0:N2}")

    Regards,
    Danail Vasilev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. DuelingCats
    DuelingCats avatar
    49 posts
    Member since:
    Jul 2012

    Posted 03 Dec 2012 Link to this post

    Thanks, I will use the N formatter for now. 
Back to Top