Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo grid column number formatting

How to set number formatting in kendo column if we bind 2 data values? In my example I have to bind value with unit, so I need a value written with 2 decimals. My code looks like:

{
    field: "Quantity",
    title: "Value ",
    width: "70px",
    type: "number",
    format:"{0:n2}",
    template: "#:Quantity# #:Unit#",
    attributes:{style:"text-align:right;"}
},

Without binding it to unit it works great, but with unit I have a problem. Thanks in advance

like image 206
Aviator Avatar asked Feb 13 '15 15:02

Aviator


1 Answers

This will format Quantity to show as a number with 2 decimals

template: '#= kendo.toString(Quantity, "n2")#  #=Unit#'
like image 115
Rick S Avatar answered Sep 29 '22 03:09

Rick S