ラベル Format の投稿を表示しています。 すべての投稿を表示
ラベル Format の投稿を表示しています。 すべての投稿を表示

2015年4月3日金曜日

kendo ui grid 数字columnでゼロならブランクにしたい

kendo ui grid 数字columnでゼロならブランクにしたい

指定columnに templateを配置
templateに処理ロジックを埋め込む

 columns: [
  { hidden: true, field: "RepairNo" },
  { field: "ReceiveNo",    title: "受付No",     filterable: false, width: 80 },
  { field: "UnitName",     title: "ユニット名", filterable: false },
  { field: "SerialNo",     title: "シリアル",   filterable: false, width:160 },
  { field: "ReceiveDate",  title: "受付日",     filterable: false, format: "{0:yyyy/MM/dd}", width :105 },
  { field: "ShipDate",     title: "発送日",     filterable: false, format: "{0:yyyy/MM/dd}", width: 105 },
  { field: "Transpoter",   title: "配送業者",   filterable: false, width: 100 },
  { field: "TranspotNo",   title: "送り状No",   filterable: false },
  { field: "RepairAmount", title: "修理金額", filterable: false, width: 100,
      template: "#if (RepairAmount != 0) {# #= RepairAmount # #}else{#   #}#" }
],

2012年7月4日水曜日

C# string.format 数字を0埋め

0埋め String.Format("{0:D4}", num)
または
String.Format("{0:0000}", num)
“0001”