Skip to main content

DataItemNumericFormat Class

Contains format settings for numeric values.

#Declaration

TypeScript
export class DataItemNumericFormat extends SerializableModel

#Remarks

The DataItemNumericFormat class provides format settings for numeric values, including the precision, unit, currency and format type.

To access numeric format settings, use the DataItem.NumericFormat property.

#Inherited Members

#constructor

Initializes a new instance of the DataItemNumericFormat class.

#Declaration

TypeScript
constructor(
    modelJson?: any,
    serializer?: DevExpress.Analytics.Utils.ModelSerializer
)

#Parameters

Name Type Description
modelJson any

A JSON object used for dashboard deserialization. Do not pass this parameter directly.

serializer ModelSerializer

An object used for dashboard deserialization. Do not pass this parameter directly.

#Properties

#currencyCultureName Property

Gets or sets the name of a culture that defines the currency symbol and format.

#Declaration

TypeScript
currencyCultureName: ko.Observable<string>

#Property Value

Type Description
Observable<string>

A string that specifies the name of a culture that defines the currency format settings.

#Remarks

If the currencyCultureName property is set to null (Nothing in Visual Basic), the currency symbol and format are defined by the currencyCultureName property. For a list of culture names, refer to the Available Language Packs for Windows Microsoft topic.

#customFormatString Property

Specifies a custom format string.

#Declaration

TypeScript
customFormatString: ko.Observable<string>

#Property Value

Type Description
Observable<string>

A custom format string.

#Remarks

You can create a custom numeric format string, which consists of one or more custom numeric specifiers, to define how to format numeric data. A custom numeric format string is any format string that is not a standard numeric format string.

To display custom formats in the Web Dashboard, enable the customNumericFormatMode property on the client side and the CustomNumericFormatMode property on the server side.

The Dashboard Controls for Web and Desktop use two custom formats that are not fully compatible with each other. Desktop Dashboard Controls use .NET formatting, while the Web Dashboard Control uses DevExtreme formatting when it displays elements and .NET formatting for export. Use the customNumericFormatMode property to enable a custom format at your own risk. To set a custom format string, use the customFormatString property.

#formatType Property

Specifies the format type for numeric values.

#Declaration

TypeScript
formatType: ko.Observable<DevExpress.Dashboard.Model.DataItemNumericFormatType>

#Property Value

Type Description
Observable<DataItemNumericFormatType>

A DataItemNumericFormatType value that specifies the format type for numeric values.

#includeGroupSeparator Property

Gets or sets whether separators should be inserted between digit groups.

#Declaration

TypeScript
includeGroupSeparator: ko.Observable<boolean>

#Property Value

Type Description
Observable<boolean>

true, to insert separators between digit groups; otherwise, false.

#precision Property

Gets or sets the number of fractional digits that should be displayed.

#Declaration

TypeScript
precision: ko.Observable<number>

#Property Value

Type Description
Observable<number>

An integer value that specifies the number of fractional digits that should be displayed.

#unit Property

Specifies the unit to which numeric values should be converted.

#Declaration

TypeScript
unit: ko.Observable<DevExpress.Dashboard.Model.DataItemNumericUnit>

#Property Value

Type Description
Observable<DataItemNumericUnit>

A DataItemNumericUnit value that specifies the unit to which numeric values should be converted.

#Methods

#getInfo Method

For internal use.

#Declaration

TypeScript
getInfo(): DevExpress.Analytics.Utils.ISerializationInfoArray

#Returns

Type Description
ISerializationInfoArray

An array of objects that provide serialization info.