Skip to main content
A newer version of this page is available. .
All docs
V22.2

NumericMaskAttribute.AlwaysShowDecimalSeparator Property

Gets or sets whether to display the decimal separator even if the fractional part is zero.

Namespace: DevExpress.Mvvm.DataAnnotations

Assembly: DevExpress.Mvvm.v22.2.dll

NuGet Package: DevExpress.Mvvm

Declaration

public bool AlwaysShowDecimalSeparator { get; set; }

Property Value

Type Default Description
Boolean false

true to display the decimal separator even if the fractional part is zero; otherwise, false.

Remarks

The AlwaysShowDecimalSeparator property has a lower priority than the applied mask. For example, if the AlwaysShowDecimalSeparator property is set to false and the mask is set to ##.00, the decimal separator is always displayed.

The following code sample demonstrates how to use the AlwaysShowDecimalSeparator property:

NumericMask Attribute - AlwaysShowDecimalSeparator

using DevExpress.Mvvm.DataAnnotations;
// ...
public class DataItem {
    public int Id { get; set; }
    [NumericMask(UseAsDisplayFormat = true, AlwaysShowDecimalSeparator = true)]
    public double ShowDecimalSeparator { get; set; }
    [NumericMask(UseAsDisplayFormat = true, AlwaysShowDecimalSeparator = false)]
    public double HideDecimalSeparator { get; set; }
}
See Also