Format a tooltip template

5 posts, 1 answers
  1. Philip
    Philip avatar
    13 posts
    Member since:
    Nov 2011

    Posted 30 Nov 2011 Link to this post

    Hello,

    I'm using a template for my tooltip, and I'd like to format the ${value} part of the template. Can you let me know how the syntax would look to format as say currency? Thanks

    tooltip: {
        visible: true,
        template: "${category}<br />Claim Cost: ${value}"
    }
  2. Answer
    Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 02 Dec 2011 Link to this post

    Hello Philip,

    To change the display format you can use the kendo.format method.
    e.g.

    tooltip: {
        visible: true,
        template: "#=category#<br />Claim Cost: #= kendo.format('{0:C}',value) #"
    }


    Regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Philip
    Philip avatar
    13 posts
    Member since:
    Nov 2011

    Posted 02 Dec 2011 Link to this post

    Thanks Petur...works great.

    Is there a manual to everything that kendo.format can do, or can I compare it to a regular method such as string.format and assume it can do everything that string.format can do?
  4. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 05 Dec 2011 Link to this post

    Hi Philip,

    Yes kendo.format is similar to the c# string.Format method. For the moment there is no manual available.

    Greetings,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Alex
    Alex avatar
    7 posts
    Member since:
    May 2012

    Posted 05 Jul 2012 Link to this post

    Is it not possible to use custom format strings? (i.e: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx )
    From what I've been trying out, only the standard ones (http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx) work.
Back to Top