ClientRowTemplate Double and Decimal Formatting

2 posts, 0 answers
  1. Jako
    Jako avatar
    107 posts
    Member since:
    Apr 2012

    Posted 22 Sep 2014 Link to this post

    .Columns(columns =>
                              {
                                  columns.Template(e => { }).ClientTemplate(" ").Title("Store Name");
                                  columns.Bound(c => c.Value).Format("R {0:n2}");
                                  columns.Bound(c => c.Quantity).Format("{0:n0}");
                                  columns.Bound(c => c.ASP).Format("R {0:n2}");
                              })
                              .HtmlAttributes(new { style = "height: 900px;" })
                              .Events(ev => ev.DataBound("onDataBound"))
                              .ClientRowTemplate(
                                                    "<tr data-uid='#: uid #'>" +
                                                        "<td ><a href='/Dashboard/Store/#= StoreId #'>" +
                                                            "#: Element #" +
                                                        "</a></td>" +
                                                        "<td class='text-right' >R " +
                                                            "#: Value #" +
                                                        "</td>" +
                                                        "<td  class='text-right'>" +
                                                            "#: Quantity #" +
                                                        "</td>" +
                                                        "<td class='text-right' >R " +
                                                           "#: ASP #" +
                                                        "</td>"+
                                                     "</tr>"     
                                )

    Hello

    I would like to know how to format the #: ASP # for it to format to decimal with 2  digits ({0:n2})
    Regards
  2. Jako
    Jako avatar
    107 posts
    Member since:
    Apr 2012

    Posted 23 Sep 2014 in reply to Jako Link to this post

    #: kendo.toString(ASP,'n2') #
Back to Top