Skip to main content
All docs
V24.1

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.v24.1.dll

NuGet Packages: DevExpress.Mvvm, DevExpress.Win.Navigation

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