formatSpec

Specifies a formatting instruction to be used for representing data on the screen. The formatting instruction is specific to the format type, Date, Number, or Text.

To format cells or col­umns of a Table, use the tablelens property.

Example (Date Format)

format = StyleConstant.DATE_FORMAT;

formatSpec = "MM/dd/yyyy";

Example (Number Format)

format = StyleConstant.DECIMAL_FORMAT;

formatSpec = "#,###.00";

Example (Text Format)

format = StyleConstant.MESSAGE_FORMAT;

formatSpec = "{0} Inc."

Date masks follow the java.text.SimpleDate­Format format.

Date Format: For date formatting, use the following date masks:

M = Month

d = date

y = year

E = day of the week

Example:

For the date Nov 8, 2006:

 

M = 11; MM = 11; MMM = Nov; MMMM = November

d = 8; dd = 08;

yy = 06; yyyy = 2006

EEE = Wed

EEEE = Wednesday

Therefore, mask 'MMM-dd-yyyy' yields “Nov-08-2006.”

Numeric masks fol­low the java.text.Deci­malFormat format.

Number Format: For number formatting, use the following numeric masks:

# = number

0 = Number with zero padding

Example:

For the number 124521.63:

#,###.##  yields 124,521.63

#,###.000 yields 124,521.630

Text Format: For text formatting, use {0} as a placeholder for the string data.

Example:

For the string 'Susan':

Salesperson: {0}  yields Salesperson: Susan

--{0}-- yields --Susan--

See Also

formatDate, for details on date formatting syntax.

formatNumber, for details on decimal formatting syntax.

Format Tab, in Dashboard Design, for more information about format specifications.

<< format © 1996-2013 InetSoft Technology Corporation (v11.5) position >>