Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxNumericMaskProperties.AlwaysShowDecimalSeparator Property

Specifies whether to show the decimal separator (even if the fractional part is zero).

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(true)]
[Parameter]
public bool AlwaysShowDecimalSeparator { get; set; }

#Property Value

Type Default Description
Boolean true

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

#Remarks

Set the AlwaysShowDecimalSeparator property to false to hide the decimal separator when the fractional part is zero.

<DxSpinEdit @bind-Value="@Price"
            Mask="##0.##">
    <DxNumericMaskProperties AlwaysShowDecimalSeparator=false />
</DxSpinEdit>

@code {
    Double Price { get; set; } = 123.00;
}

SpinEdit Separator

Note that the decimal separator (.) is hidden only if the specified mask allows it. For example, if the mask is ###.00 and AlwaysShowDecimalSeparator is false, the decimal separator (.) is shown.

Razor
<DxSpinEdit @bind-Value="@Price"
            DisplayFormat="###.00"
            Mask="###.00">
    <DxNumericMaskProperties AlwaysShowDecimalSeparator=false/>
</DxSpinEdit>

@code {
    Double Price { get; set; } = 123.00;
}

SpinEdit Show Separator

If you set the AlwaysShowDecimalSeparator property to false, a user still can enter values with the separator, for example, 123.00. However, the separator is hidden when the editor loses focus.

See Also