Display Format specifies how the value entered in a User Field should be displayed when the field is not focused (i.e. when you have clicked or tabbed out of the field).
It is typically used for Date-related and numeric type user fields, e.g. Date, Time, Date/Time, Currency, and Double.
In the Setup User Field edit form, you define the Display Format by entering a combination of format specifier characters that indicate how the value entered in the User Field should appear.
In this example, we are creating a User Field for the "Company" Data Type.
In the Setup User Field edit form, we have selected the "Double" Field Type.
We want the number to be displayed to 3 decimal places, so we enter the format specifier N3 in the Display Format field. (See the tables at the bottom of this topic for commonly used format specifiers).
Figure 1025: Defining Display Format
Now we are in the User Fields window opened from the Company edit form.
Because we are still in the process of entering a value in the Double user field, the field is focused, so the display formatting is not yet applied.
Figure 1026: Entering Double Number Value
Still in the Company's User Fields form, we have finished entering a value in the Double field, and tabbed out of the field.
The field is now not focused, so our selected display formatting is applied.
Figure 1027: Displaying Double Number Format
The tables below show some of the most commonly used format specifiers, which are the same as those from the standard formatting mechanism described in MSDN.
Name |
Use for this User Field Type |
Format Specifier |
Result |
Precision Specifier |
Example |
Currency |
Currency |
C or c
|
A currency value This will add the currency symbol defined by your regional settings, e.g. $ for en-US, or £ for en-UK. |
Number of decimal digits. If no precision specifier is supplied, it will use the default currency precision from the current regional options. |
Value entered: 1234.567
With en-US settings C -> $1,234.57 C3 -> $1,234.567
With en-GB settings C -> £1,234.57 |
Fixed Point |
Double |
F or f |
Integral and decimal digits with optional negative sign |
Number of decimal digits |
With en-US settings
Value entered: 1234.567 F -> 1234.57
Value entered: 1234 F1 -> 1234.0 |
Number |
Double |
N or n |
Integral and decimal digits, group separators, and a decimal separator with optional negative sign |
Desired number of decimal places |
With en-US settings
Value entered: 1234.567 N -> 1,234.57
Value entered: -1234.56 N3 -> -1,234.560 |
Percent |
Double |
P or p |
Number multiplied by 100 and displayed with a percent symbol |
Desired number of decimal places |
With en-US settings
Value entered: 1 P -> 100.00 %
Value entered: -0.39678 P1 -> -39.7 % |
Used for the Date, Time and Date/Time User Field types.
Sample value entered (with en-US settings): June 15, 2015, 13:15:30
Format Specifier |
Description |
Example |
d |
Short date pattern |
6/15/2015 |
D |
Long date pattern |
Monday, June 15, 2015 |
f |
Full date/time pattern (short time) |
Monday, June 15, 2015 1:15 PM |
F |
Full date/time pattern (long time) |
Monday, June 15, 2015 1:15:30 PM |
Used for the Date, Time and Date/Time User Field types.
You can create a custom date and time format string by combining format specifiers in a pattern of your choice.
Format Specifier |
Description |
d |
The day of the month, from 1 through 31 |
dd |
The day of the month, from 01 through 31 |
ddd |
The abbreviated name of the day of the week |
dddd |
The full name of the day of the week |
h |
The hour, using a 12-hour clock from 1 to 12 |
hh |
The hour, using a 12-hour clock from 01 to 12 |
H |
The hour, using a 24-hour clock from 0 to 23 |
HH |
The hour, using a 24-hour clock from 00 to 23 |
m |
The minute, from 0 through 59 |
mm |
The minute, from 00 through 59 |
M |
The month, from 1 through 12 |
MM |
The month, from 01 through 12 |
MMM |
The abbreviated name of the month |
MMMM |
The full name of the month |
s |
The second, from 0 through 59 |
ss |
The second, from 00 through 59 |
t |
The first character of the AM/PM designator |
tt |
The AM/PM designator |
yy |
The year, from 00 to 99 |
yyyy |
The year as a four-digit number |
/ |
Date separator |
: |
Time separator |
The following are some custom formatting examples for Date, Time and Date/Time User Fields, although there are many other possible variations.
Sample value entered (with en-US settings): June 8, 2016, 13:15:45
Sample Strings |
Results |
d-m-yy |
8-6-16 |
dddd, MMMM dd, yyyy |
Wednesday, June 08, 2016 |
dd/mm/yy hh:mm:ss t |
08/06/16 01:30:45 P |
h:mm tt |
1:30 PM |
ddd, MMM d, HH:mm |
Wed, Jun 8, 13:30 |