【发布时间】:2016-04-16 11:02:16
【问题描述】:
在使用具有以下 maven 依赖项的 Apache CSV 时。我得到了意想不到的结果。
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.2</version>
</dependency>
简单的代码无法按预期为我工作。 谁能告诉我这里出了什么问题?
System.out.println(CSVFormat.DEFAULT.format("-10","10"));
实际输出:"-10",10
预期输出:-10,10
System.out.println(CSVFormat.DEFAULT.format("10","-10"));
实际输出:10,-10
预期输出:10,-10
System.out.println(CSVFormat.DEFAULT.format(".10","-10"));
实际输出:".10",-10
预期输出:.10,-10
System.out.println(CSVFormat.DEFAULT.format("+10","-10"));
实际输出:"+10",-10
预期输出:+10,-10
【问题讨论】:
-
所以默认格式不是你所期望的,而且?
-
是的,我认为它在 Apache CSV 中存在错误。
-
我建议您找到一些支持您的错误想法的官方文档并使用该信息编辑您的问题
-
谢谢,我在 Apache CSV Jira issues.apache.org/jira/browse/CSV-148 中发现了类似的错误