EAS BOS KDTable的显示格式设置

table.getColumn(colIndex).getStyleAttributes().setNumberFormat(formatString); //设置某列显示格式
table.getCell(rowIndex, colIndex).getStyleAttributes().setNumberFormat(formatString); //设置某单元格显示格式

//1.数值类
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("0.00");//0.00 表示显示两位小数,末尾为0时0仍显示
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("0.##");//0.## 表示显示两位小数,末尾为0时0不显示
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("#,##0.00");//#,##0.00 表示显示两位小数,且显示千分位

//2.日期类 
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("yyyy-m-d");
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("yyyy-MM-dd");
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("yyyy-MM-dd HH:mm:ss");
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("yyyy年MM月dd日");

//3.百分比
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("0%");
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("0.00%");

猜你喜欢

转载自blog.csdn.net/qq_25170493/article/details/83892363