Skip to main content
A newer version of this page is available. .

DataItemNumericFormat Class

Contains format settings for numeric values.

Declaration

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.

constructor

Initializes a new instance of the DataItemNumericFormat class.

Declaration

constructor(
    modelJson?: any,
    serializer?: 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

currencyCultureName: ko.Observable<string>

Property Value

Type
Observable<string>

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

customFormatString: ko.Observable<string>

Property Value

Type
Observable<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

formatType: ko.Observable<DataItemNumericFormatType>

Property Value

Type
Observable<DataItemNumericFormatType>

includeGroupSeparator Property

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

Declaration

includeGroupSeparator: ko.Observable<boolean>

Property Value

Type
Observable<boolean>

precision Property

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

Declaration

precision: ko.Observable<number>

Property Value

Type
Observable<number>

unit Property

Specifies the unit to which numeric values should be converted.

Declaration

unit: ko.Observable<DataItemNumericUnit>

Property Value

Type
Observable<DataItemNumericUnit>

Methods

getInfo Method

For internal use.

Declaration

getInfo(): ISerializationInfoArray

Returns

Type Description
ISerializationInfoArray

An array of objects that provide serialization info.