This is a migrated thread and some comments may be shown as answers.

Format a tooltip template

4 Answers 1618 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 30 Nov 2011, 11:50 PM
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}"
}

4 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 02 Dec 2011, 04:44 PM
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!
0
Philip
Top achievements
Rank 1
answered on 02 Dec 2011, 07:50 PM
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?
0
Petur Subev
Telerik team
answered on 05 Dec 2011, 02:19 PM
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!
0
Alex
Top achievements
Rank 1
answered on 05 Jul 2012, 08:24 PM
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.
Tags
Charts
Asked by
Philip
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Philip
Top achievements
Rank 1
Alex
Top achievements
Rank 1
Share this question
or