dashboard-15697-winforms-dashboard-winforms-designer-create-dashboards-in-the-winforms-designer-data-shaping-formatting-data.md
Dashboard allows you to customize various data format settings for numeric and date-time values.
To specify a format for numeric values, select Format in the data item menu.
This invokes the Numeric Format window.
In the Format type field, select the required format type (the DataItemNumericFormat.FormatType property). Format types that can be specified are described in the table below.
| Format type | Description | Examples |
|---|---|---|
| Auto | Format settings are automatically determined based on the data type. | |
| General | Converts a number to the most compact fixed-point or scientific notation. | |
| Number | Converts a number to a string of the “-d,ddd,ddd.ddd…” form where “-“ indicates a negative number symbol (if required), “d” indicates a digit (0-9), “,” indicates a group separator, and “.” indicates a decimal point symbol. | 1234.567 → 1,234.57 (en-US) |
| Currency | Converts a number to a string that is a currency amount. To learn about currency formatting specifics, see the Currency Formatting Specifics section of this document. | 123.456 → $123.46 (en-US) |
| Scientific | Converts a number to a string of the “-d.ddd…E+ddd” or “-d.ddd…e+ddd” form where each “d” indicates a digit (0-9). | 1052.0329112756 → 1.052033E+003 (en-US) |
| Percent | Multiplies a number by 100 and converts it to a percentage string. | -0.39678 → -39.7 % (en-US) |
Other format settings are only in effect for specific format types.
|
Setting
|
Description
|
Format Types
|
API
| | --- | --- | --- | --- | |
Unit
|
The unit to which values should be converted.
|
Number, Currency
|
| |
Precision
|
The number of fractional digits that should be displayed.
|
Scientific, Percentage
|
DataItemNumericFormat.Precision
| |
Currency
|
Defines the currency sign and format settings that should be used to display currency values.
To learn about currency formatting specifics, see the Currency Formatting Specifics section of this document.
|
Currency
| | |
Currency culture
|
For currencies used in a region with several cultures, specifies the culture that defines format settings.
|
Currency
|
DataItemNumericFormat.CurrencyCultureName
| |
Include group separator
|
Specifies whether separators should be inserted between digit groups.
|
Number, Currency, Percentage
|
DataItemNumericFormat.IncludeGroupSeparator
|
The DataItem.NumericFormat property provides access to the format settings for numeric values.
To specify a format for date-time values, use the Format submenu in the data item menu.
This submenu lists the available format types that depend on the selected group interval (for details on group intervals, see the Grouping topic).
Several group intervals do not have format options and corresponding values can only be presented in a single manner. The Format submenu is not displayed for such group intervals.
To specify a format for date-time values in code, use the DataItem.DateTimeFormat property. This property returns the DataItemDateTimeFormat object, which allows you to specify formatting for different group intervals.
The following table lists format types by group interval.
|
Group Interval
|
Format type
|
Description
|
Examples
|
API
| | --- | --- | --- | --- | --- | |
Year
|
Full
Abbreviated
|
The full year pattern.
The year from 00 to 99.
|
6/15/2009 1:45:30 PM → 2009 (en-US)
6/15/2009 1:45:30 PM → 09 (en-US)
|
DataItemDateTimeFormat.YearFormat
| |
Quarter
|
Full
Numeric
|
The full quarter pattern.
The quarter from 1 through 4.
|
6/15/2009 1:45:30 PM → Q2 (en-US)
6/15/2009 1:45:30 PM → 2 (en-US)
|
DataItemDateTimeFormat.QuarterFormat
| |
Month
|
Full
Abbreviated
Numeric
|
The full name of the month.
The abbreviated name of the month.
The month from 1 through 12
|
6/15/2009 1:45:30 PM → June (en-US)
6/15/2009 1:45:30 PM → Jun (en-US)
6/15/2009 1:45:30 PM → 6 (en-US)
|
DataItemDateTimeFormat.MonthFormat
| |
Hour
|
Long
Short
|
Long hour pattern, 12-hour format.
Short hour pattern, 24-hour format.
|
6/15/2009 1:45:30 PM → 1:00 PM
6/15/2009 1:45:30 PM → 13
|
DataItemDateTimeFormat.HourFormat
| |
Day of Week
|
Full
Abbreviated
Numeric
|
The full name of the day of the week.
The abbreviated name of the day of the week.
The day of the week from 1 through 7.
|
6/15/2009 1:45:30 PM → Monday (en-US)
6/15/2009 1:45:30 PM → Mon (en-US)
6/15/2009 1:45:30 PM → 2 (en-US)
|
DataItemDateTimeFormat.DayOfWeekFormat
| |
Day-Month-Year
|
Long
Short
|
Long date pattern.
Short date pattern.
|
6/15/2009 1:45:30 PM → Monday, June 15, 2009 (en-US)
6/15/2009 1:45:30 PM → 6/15/2009 (en-US)
|
DataItemDateTimeFormat.DateFormat
| |
Date-Hour
|
Long
Short
Time only
|
Long date pattern, long hour pattern.
Short date pattern, long hour pattern.
Long hour pattern.
|
6/15/2009 1:45:30 PM → Monday, June 15, 2009 1:00 PM (en-US)
6/15/2009 1:45:30 PM → 6/15/2009 1:00 PM (en-US)
6/15/2009 1:45:30 PM → 1:00 PM (en-US)
|
DataItemDateTimeFormat.DateHourFormat
| |
Date-Hour-Minute
|
Long
Short
Time only
|
Long date pattern, short time pattern.
Long date pattern, short time pattern.
Short time pattern.
|
6/15/2009 1:45:30 PM → Monday, June 15, 2009 1:45 PM (en-US)
6/15/2009 1:45:30 PM → 6/15/2009 1:45 PM (en-US)
6/15/2009 1:45:30 PM → 1:45 PM (en-US)
|
DataItemDateTimeFormat.DateHourMinuteFormat
| |
Date-Hour-Minute-Second
|
Long
Short
Time only
|
Long date pattern, long time pattern.
Short date pattern, long time pattern.
Long time pattern.
|
6/15/2009 1:45:30 PM → Monday, June 15, 2009 1:45:30 PM (en-US)
6/15/2009 1:45:30 PM → 6/15/2009 1:45:30 PM (en-US)
6/15/2009 1:45:30 PM → 1:45:30 PM (en-US)
|
DataItemDateTimeFormat.DateTimeFormat
|
The table below lists format types related to the Exact Date group interval. You can specify the format of exact values in code using the DataItemDateTimeFormat.ExactDateFormat property and corresponding properties from the table below.
Note
Time formats (Hour, Minute, Second) are not available for DateOnly fields.
|
Exact Date and Time Format
|
Format Type
|
Description
|
Examples
|
API
| | --- | --- | --- | --- | --- | |
Year
|
Full
Abbreviated
|
The full year pattern.
The year from 00 to 99.
|
6/15/2009 1:45:30 PM → 2009 (en-US)
6/15/2009 1:45:30 PM → 09 (en-US)
|
DataItemDateTimeFormat.YearFormat
| |
Quarter
|
n/a
|
The default year and full quarter pattern.
|
6/15/2009 1:45:30 PM → Q2 2009 (en-US)
|
n/a
| |
Month
|
n/a
|
The default year pattern and the full name of the month.
|
6/15/2009 1:45:30 PM → June, 2009 (en-US)
|
n/a
| |
Day
|
Long
Short
|
Long date pattern.
Short date pattern.
|
6/15/2009 1:45:30 PM → Monday, June 15, 2009 (en-US)
6/15/2009 1:45:30 PM → 6/15/2009 (en-US)
|
DataItemDateTimeFormat.DateFormat
| |
Hour
|
Long
Short
Time only
|
Long date pattern, long time pattern.
Short date pattern, long time pattern.
Long time pattern.
|
6/15/2009 1:45:30 PM → Monday, June 15, 2009 1:00 PM (en-US)
6/15/2009 1:45:30 PM → 6/15/2009 1:00 PM (en-US)
6/15/2009 1:45:30 PM → 1:00 PM (en-US)
|
DataItemDateTimeFormat.DateHourFormat
| |
Minute
|
Long
Short
Time only
|
Long date pattern, long time pattern.
Short date pattern, long time pattern.
Long time pattern.
|
6/15/2009 1:45:30 PM → Monday, June 15, 2009 1:45 PM (en-US)
6/15/2009 1:45:30 PM → 6/15/2009 1:45 PM (en-US)
6/15/2009 1:45:30 PM → 1:45 PM (en-US)
|
DataItemDateTimeFormat.DateHourMinuteFormat
| |
Second
|
Long
Short
Time only
|
Long date pattern, long time pattern.
Short date pattern, long time pattern.
Long time pattern.
|
6/15/2009 1:45:30 PM → Monday, June 15, 2009 1:45:30 PM (en-US)
6/15/2009 1:45:30 PM → 6/15/2009 1:45:30 PM (en-US)
6/15/2009 1:45:30 PM → 1:45:30 PM (en-US)
|
DataItemDateTimeFormat.DateTimeFormat
|
The table below lists format types related to the DateTimeGroupInterval.None group interval. You can use the DataItemDateTimeFormat.ExactTimeFormat property to specify the exact value format in code.
| Exact Time Format | Format type | Description | Examples | API |
|---|---|---|---|---|
| Hour | n/a | The default time pattern that displays only hours. | 1:45:30 PM → 1 PM (en-US) | n/a |
| Minute | n/a | The default time pattern that displays hours and minutes. | 1:45:30 PM → 1:45 PM (en-US) | n/a |
| Second | n/a | The default time pattern that displays hours, minutes, and seconds. | 1:45:30 PM → 1:45:30 PM (en-US) | n/a |
The Dashboard allows you to specify currency formats at two levels: for individual data items and for the entire dashboard.
Data Item Currency
Dashboard Currency
| API | Description |
|---|---|
| DataItem.NumericFormat | Provides access to the format settings for numeric values. |
| DataItem.DateTimeFormat | Provides access to the format settings for date-time values. |
| Dashboard.CurrencyCultureName | Gets or sets the default currency for the Dashboard. |
| DataItemNumericFormat | Contains format settings for numeric values. |
| DataItemDateTimeFormat | Contains formatting settings for date-time values. |