private String QueryDataSetGetValue(QueryDataSet QDSTable, int i) {

    String str = ""

    int type = QDSTable.getColumn(i).getDataType();

    if (type == Variant.DOUBLE ) {

        NumberFormat nf = new DecimalFormat("#");

        double d = QDSTable.getDouble(i);

        str = nf.format(d);

    } else {

        str = QDSTable.format(i);

    }

    return str;

}

 

參考:用NumberFormat來將數字格式化技巧(頁 1) - JAVA樂園 - 精華區 - 微風論壇 台灣人氣bbs論壇社區 - Powered by Discuz! Archiver

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 fabch2 的頭像
    fabch2

    小刻家

    fabch2 發表在 痞客邦 留言(0) 人氣()