1

私は jxl を使用して小さな jtable を Excel にエクスポートしています。JXL API を選択して目的を実現しています。すべてうまくいっています。しかし、数値形式についてはまだ小さな問題があります:

以下の例のように小数点記号を追加するにはどうすればよいですか:

------------------------
2365897412
------------------------

------------------------
2 365 897 412
------------------------

どうもありがとう

4

1 に答える 1

0
NumberFormat nf=new NumberFormat("#,###.###");                   // this format constraints the number upto 3 decimal points
WritableCellFormat cf2obj=new WritableCellFormat(nf);
numobj=new Number(2,1,3698745896546.353454,cf2obj);
sheet.addCell(numobj);

Excelシートの出力は次のようになります

3 698 745 896 546,35

ありがとう

于 2013-08-05T13:34:02.840 に答える