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

Setting ClientFooterTemplate - 2 decimal places

1 Answer 1529 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 2
Ian asked on 12 Jul 2013, 05:46 PM
In my column, i wish to display the client footer as a 2 decimal number, right aligned. How do I edit the ClientFooterTemplate to do that:

So far I have the sum appearing fine, just not formatted:

columns.Bound(e => e.MarketValue).Title("Mkt. Value ($)")
       .ClientFooterTemplate("#=sum#")
       .HeaderHtmlAttributes(new { style = "text-align: right;" })
       .HtmlAttributes(new { @class = "aright" });


1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 15 Jul 2013, 07:28 AM
Hello Ian,

This can be done using the kendo.toString() or kendo.format methods to achieve this functionality. 

footerTemplate: "Total Products : #= kendo.toString(sum, '0.00') #"

To read more about number formatting with Kendo UI please follow this link:

http://docs.kendoui.com/getting-started/framework/globalization/numberformatting

 

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Ian
Top achievements
Rank 2
Answers by
Kiril Nikolov
Telerik team
Share this question
or