Back to Devexpress

NumericOptions.Precision Property

corelibraries-devexpress-dot-xtracharts-dot-numericoptions.md

latest2.6 KB
Original Source

NumericOptions.Precision Property

Gets or sets the maximum number of digits displayed to the right of the decimal point.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public int Precision { get; set; }
vb
Public Property Precision As Integer

Property Value

TypeDescription
Int32

An integer value that specifies the maximum number of digits displayed in the fractional part of the value.

|

Remarks

Use the Precision property to specify the maximum number of digits displayed to the right of a value’s decimal point when the NumericOptions.Format property is not set to the NumericFormat.General value.

Example

This example demonstrates how to make series point labels of a pie chart show their values as percentages.

Note that to achieve this at runtime, you should cast the series’ SeriesBase.PointOptions to the PiePointOptions type.

csharp
// Make the series points' values to be displayed as percents.
((PiePointOptions)series1.PointOptions).PercentOptions.ValueAsPercent = true;
((PiePointOptions)series1.PointOptions).ValueNumericOptions.Format = NumericFormat.Percent;
((PiePointOptions)series1.PointOptions).ValueNumericOptions.Precision = 0;
vb
' Make the series points' values to be displayed as percents.
CType(series1.PointOptions, PiePointOptions).PercentOptions.ValueAsPercent = True
CType(series1.PointOptions, PiePointOptions).ValueNumericOptions.Format = NumericFormat.Percent
CType(series1.PointOptions, PiePointOptions).ValueNumericOptions.Precision = 0

See Also

NumericOptions Class

NumericOptions Members

DevExpress.XtraCharts Namespace