public class CellNumberFormatter extends CellFormatter
format, locale
Constructor and Description |
---|
CellNumberFormatter(java.util.Locale locale, java.lang.String format)
Creates a new cell number formatter.
|
CellNumberFormatter(java.lang.String format)
Creates a new cell number formatter.
|
Modifier and Type | Method and Description |
---|---|
void |
formatValue(java.lang.StringBuffer toAppendTo, java.lang.Object valueObject)
Format a value according the format string.
(根据格式字符串格式化一个值。)
|
void |
simpleValue(java.lang.StringBuffer toAppendTo, java.lang.Object value)
Format a value according to the type, in the most basic way.
(以最基本的方式根据类型格式化一个值。)
|
format, simpleFormat
public CellNumberFormatter(java.lang.String format)
format
- The format to parse.
(format - 要解析的格式。)
public CellNumberFormatter(java.util.Locale locale, java.lang.String format)
locale
- The locale to use.
(locale - 要使用的语言环境。)
format
- The format to parse.
(format - 要解析的格式。)
public void formatValue(java.lang.StringBuffer toAppendTo, java.lang.Object valueObject)
formatValue
in class
CellFormatter
(类 CellFormatter 中的 formatValue)
toAppendTo
- The buffer to append to.
(toAppendTo - 要附加到的缓冲区。)
valueObject
- The value to format.
(valueObject - 要格式化的值。)
public void simpleValue(java.lang.StringBuffer toAppendTo, java.lang.Object value)
For a number, this is "#" for integer values, and "#.#" for floating-point values.
(以最基本的方式根据类型格式化一个值。注意:此方法必须是线程安全的!特别是,如果它使用非线程安全的 Format 实例,即 DateFormat,则此方法必须在方法上同步,如果格式是最终属性,或者在格式实例本身上同步。对于数字,“#”表示整数值,“#.#”表示浮点值。)simpleValue
in class
CellFormatter
(CellFormatter 类中的 simpleValue)
toAppendTo
- The buffer to append to.
(toAppendTo - 要附加到的缓冲区。)
value
- The value to format.
(value - 要格式化的值。)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.