Picture Strings

The picture attribute of a field element specifies how entries in the field's index are formatted when listed by the NXT 4 server. For example, picture="mm/dd/yy" sets the picture string to Month/Day/Year which converts to 01/01/99 or 12/20/99 when viewed in a word wheel, regardless of the way it displays in the content collection. NXT 4 includes Web controls for a word wheel that can be used to list field terms.

You can use picture strings to control the formatting of time, date, integer, and double values.

note icon The available picture strings are dependent on the language module used.

Time

Field Format Example
h:mm 6:19 pm
h:mm:ss 6:19:11 pm
H:mm 18:19
H:mm:ss 18:19:11
hh:mm 06:19 pm
hh:mm:ss 06:19:11 PM
HH:mm 18:19
HH:mm:ss 18:19:11

The time field formats use these keys.

h hours, measured using a 12-hour clock, not padded (1, 2, 3, etc.)
hh hours, measured using a 12-hour clock, padded (01, 02, 03, etc.)
H hours, measured using a 24-hour clock, not padded (1, 2, 3, etc.)
HH hours, measured using a 24-hour clock, padded (01, 02, 03, etc.)
mm minutes
ss seconds

Date

Field Format Example
m/d/yy 8/3/68
mm/dd/yy 08/03/68
m/yy 8/68
m-d-yy 8-3-68
mm-dd-yy 08-03-68
Mmm-yy Aug-68
Mmm d, yyyy Aug 3, 1968
Mmmm d, yyyy August 3, 1968
dd.mm.yy 08.03.68
d Mmmm, yyyy 3 August, 1968
yyyy 1968
yy-Mmm 68-Aug
yyyy-mm-dd 1968-08-03
yyyy Mmmm d 1968 August 3

The date field formats use these keys.

m month, not padded (1, 2, 3, etc.)
d day, not padded (1, 2, 3, etc.)
y year, in four digits (1996)
mm month, padded (01, 02, 03, ... 10, 11, 12)
dd day, padded (01, 02, 03, ... 29, 30, 31)
yy year, final two digits (96)
yyyy year, in four digits (1996)
Mmm abbreviation for month, mixed case (Jan, Feb, Mar, etc.)
Mmmm month, mixed case (January, February, March, etc.)

Integer

Field Format Example Explanation
- -1000 Negatives represented by a minus sign.
, -1,000 Negatives represented by a minus sign. Comma used as thousands separator.
( ) (1000) Negatives represented by parentheses.
(, ) (1,000) Negative represented by parentheses. Comma used as thousands separator.

Double

Field Format Example Explanation
. -1000.5 Negatives represented by a minus sign. Period used as decimal separator.
.0 -1001 Rounded up or down as necessary (no decimal used).
,. -1,000.5 Negatives represented by a minus sign. Comma used as thousands separator. Period used as decimal separator.
,.0 -1,001 Rounded up or down as necessary (no decimal used). Negatives represented by a minus sign. Comma used as thousands separator. Period used as decimal separator.
( . ) (1000.5) Negatives represented by parentheses. Period used as decimal separator.
( .0 ) (1001) Rounded up or down as necessary (no decimal used). Negatives represented by parentheses. Period used as decimal separator.
( ,. ) (1,001.5) Negatives represented by parentheses. Comma used as thousands separator. Period used as decimal separator.
( ,.0 ) (1,001) Rounded up or down as necessary (no decimal used). Negatives represented by parentheses. Comma used as thousands separator. Period used as decimal separator.
$,.2 -$10,000.50 Negatives represented by a minus sign. Comma used as thousands separator. Period used as decimal separator. Two decimal places required (padded with zeros, if necessary).
($,.2) ($10,000.50) Negatives represented by parentheses. Comma used as thousands separator. Period used as decimal separator. Two decimal places required (padded with zeros, if necessary).
.% -46.5% Negatives represented by a minus sign. Period used as decimal separator. Numbers are not converted to percentages (0.345 = 0.345%).
.0% -47% Rounded up or down as necessary (no decimal used). Negatives represented by a minus sign. Period used as decimal separator. Numbers are not converted to percentages (0.345 = 0.345%).
(.%) (46.5%) Negatives represented by parentheses. Period used as decimal separator. Numbers are not converted to percentages (0.345 = 0.345%).
(.0%) (47%) Rounded up or down as necessary (no decimal used). Negatives represented by parentheses. Period used as decimal separator. Numbers are not converted to percentages (0.345 = 0.345%).