<DisplayFormat>
Section:
Attribute
Required:
No
Value type:
A valid format
Default:
See description below
Product:
Creo Elements/Direct Model Manager, Creo Elements/Direct Drawing Manager
Description
This tag defines how to display an attribute value within a specific class. The format applies to attributes displayed in tables or "Send to" items, but not to editors or DB Properties.
The system resolves the attribute, using the first valid method in this order:
1. If the attribute is a date and you specify one of the following Creo Elements/Direct Model Manager date formats, the system applies that format.
%UTC_STRING_FORMAT
yyyy/MM/dd HH:mm:ss
%UTC_STRING_FORMAT2
yyyy/MM/dd H:m:s
%UTC_SHORT_FORMAT
yyyy/MM/dd
%DEFAULT_DATE_TIME_FORMAT
Use the locale-dependent short date format with time.
%DEFAULT_DATE_FORMAT
Use the locale-dependent short date format without time.
DB_EFFECTIVE_FROM and DB_EFFECTIVE_TO are configured in wmconf.xml to use %DEFAULT_DATE_FORMAT.
2. If you specify a display format, the system applies it as C-style printf() formatting. See the Java API documentation for java.util.Formatter for more information.
3. If you do not specify formatting,
Integers appear as integers.
Doubles (floats) appear as decimals, unless the value corresponds to an integer. If you edit the value, it appears as a decimal.
Dates appear using %DEFAULT_DATE_TIME_FORMAT.
4. If none of the above methods apply, the <DisplayFormat> is not a Creo Elements/Direct Model Manager date format, or a format fails as a C-style format (for example, the attribute specifies a C-style floating point format, but the value is an integer), then the attribute value appears as entered (no formatting).
Integer effectivities
If you use integer effectivities, either remove the <DisplayFormat> tags from the database class (in your custom xml file) or change the format.
Example
Specifying
<DisplayFormat>%.0f</DisplayFormat>
for a numeric value displays the value rounded to the nearest integer.
<DisplayFormat>%.1f</DisplayFormat>
displays the value as a float with one digit after the decimal point.
Was this helpful?