Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Templates 剑道网格列号格式_Templates_Kendo Ui_Kendo Grid_Number Formatting - Fatal编程技术网

Templates 剑道网格列号格式

Templates 剑道网格列号格式,templates,kendo-ui,kendo-grid,number-formatting,Templates,Kendo Ui,Kendo Grid,Number Formatting,如果绑定2个数据值,如何在剑道列中设置数字格式?在我的例子中,我必须用单位绑定值,所以我需要一个用2个小数写的值。 我的代码如下所示: { field: "Quantity", title: "Value ", width: "70px", type: "number", format:"{0:n2}", template: "#:Quantity# #:Unit#", attributes:{style:"text-align:right

如果绑定2个数据值,如何在剑道列中设置数字格式?在我的例子中,我必须用单位绑定值,所以我需要一个用2个小数写的值。 我的代码如下所示:

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

在不绑定到单元的情况下,它工作得很好,但是对于单元,我有一个问题。提前感谢

这将格式化
数量
以2位小数的数字显示

template: '#= kendo.toString(Quantity, "n2")#  #=Unit#'

我应该把它放到我的列属性中吗?我试过了,但没有成功:/I我丢失了一个
#
标志。用上面的方法再试一次。效果很好,非常感谢,不幸的是我没有足够的声誉来标记你的评论,但是非常感谢!!