フェイルデータのExcel(フロート)

EduBw:

私はすべてがfloat型を除いて正しいaは、BDからのデータをExcelを生成しました。

3,20000004768372> - 私のBD Iでは、「3.2」を持っていますが、私のエクセルIを持っています

    try {

        XSSFSheet sheet = workbook.createSheet(eyelash);
        XSSFDataFormat format = workbook.createDataFormat();
        style.setDataFormat(format.getFormat("Text")); //I need type text for others inputs in my Excel
        styleRow.setDataFormat(format.getFormat("Text"));
        String[] header = {"width"};
        XSSFRow rowhead = sheet.createRow((short) 0);
        XSSFCell cell;

            int myRowData = 1;
            XSSFRow row = sheet.createRow((short) myRowData);

            List<MyClass> list = this.select();

            for (int i = 0; i < list.size(); i++) {

                row.createCell(0).setCellValue(list.get(i).getWidth()); 
                myRowData++;
                row = sheet.createRow((short) myRowData);

        }

    } catch (Exception ex) {}

CLASS Javaベース>

public class MyClass{

 private float width;

 public MyClass(){}

 public MyClass(float width){
   width=width;
 }

public void setWidth(float width) {
    this.width= width;
}


public Float getWidth() {
    return width;
} 

}

他の幅本物を知っていることはありませんので、私はラウンド使用することはできません。

楽天:

値の精度が問題であるならば、あなたは違いを見なければならないfloatsdoubles見られるように、ここここ

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=219132&siteId=1