日期:2014-05-18 浏览次数:20919 次
//Forces numbers to be interpreted as text
WritableFont wf = new WritableFont(WritableFont.ARIAL, 10, WritableFont.NO_BOLD, false);
DisplayFormat displayFormat = NumberFormats.TEXT;
WritableCellFormat format = new WritableCellFormat(wf,displayFormat);
format.setAlignment(jxl.format.Alignment.LEFT);
format.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.NONE);
// The available built in number formats
// First describe the fairly bog standard formats
/***
* The default format. This is equivalent to a number format of '#'
*/
public static final DisplayFormat DEFAULT = new BuiltInFormat(0x0, "#");
/***
* Formatting for an integer number. This is equivalent to a DecimalFormat
* of "0"
*/
public static final DisplayFormat INTEGER = new BuiltInFormat(0x1, "0");
/***
* Formatting for a float. This formats number to two decimal places. It
* is equivalent to a DecimalFormat of "0.00"
*/
public static final DisplayFormat FLOAT = new BuiltInFormat(0x2, "0.00");