columns.format String

The format that is applied to the value before it is displayed.

Takes the form "{0:format}" where "format" can be a:

The kendo.format function is used to format the value.

Example - specify default column format for a number field

<div id="grid"></div>
<script>
  $("#grid").kendoGrid({
    columns: [ {
      field: "product",
    }, {
      field: "number",
      format: "{0:c}"
    } ],
    dataSource: [ { product: "Chai", number: 3.1415 } ]
  });
</script>

Example - specify custom column format for a number field

<div id="grid"></div>
<script>
  $("#grid").kendoGrid({
    columns: [ {
      field: "product",
    }, {
      field: "number",
      format: "{0:0.0000}"
    } ],
    dataSource: [ { product: "Chai", number: 94 } ]
  });
</script>

Example - specify default format for a date field

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [ {
    field: "date",
    format: "{0:g}"
  }, {
    field: "product"
  } ],
  dataSource: [ { date: new Date(), product: "Chai" } ]
});
</script>

Example - specify custom format for a date field

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [ {
    field: "date",
    format: "{0: yyyy-MM-dd HH:mm:ss}"
  }, {
    field: "product"
  } ],
  dataSource: [ { date: new Date(), product: "Chai" } ]
});
</script>
In this article