【发布时间】:2014-10-02 07:14:05
【问题描述】:
我有以下 CellProcessor 方法
private static CellProcessor[] getProcessors() {
final CellProcessor[] processors = new CellProcessor[] {
new NotNull(), // senderId
new NotNull(), // orderId
new NotNull(), // execQuantity
new NotNull(), // execPrice <~~~~~~~~~~~~
new NotNull(new FmtDate("yyyy-MM-dd")), // deliveryDate
};
return processors;
}
由于 execPrice 为 Double,输出 csv 文件包含十进制值。它必须是 bean 中的双重类型。写csv文件的时候需要改一下。
如何在 supercsv 中删除十进制值(或转换为整数)?我想我必须在 CellProcessor 中使用FmtNumber,但我不知道如何。
【问题讨论】:
标签: supercsv