Java - 格式化数字并导出到Excel文档

时间:2012-10-09 12:21:01

标签: java currency data-formatters

从java类我将值54666700导出到.xlsx文档。我希望将其显示为$ 54,666,700,但在文档中它应存储为54666700,即,当我选择该列时,该值应选择为数字54666700.

至于格式化为货币我使用以下代码。

Long newsValue = 54666700
NumberFormat testFormat = NumberFormat.getCurrencyInstance(Locale.US);
testFormat.setMinimumFractionDigits(0);
String currency = testFormat.format(current);
//which will be $54,666,700

我找到了这个库Apache DataFormatter,但无法弄清楚如何在那里获取CELL对象。

任何建议/提示表示赞赏。

0 个答案:

没有答案
相关问题