Matblazor MatNumericUpDownField format attribute

115 Views Asked by At

I am trying to use the format attribute of the MatNumericUpDownField without success. I have a French culture, and I want en-US formatting. Looking for some advice on how to format an int. There is no example.

My current field:

My current field

I want 1.00 formatting. My code :

<MatNumericUpDownField Label="@localiser["MaterialGroupFactor"]" 
 @bind-Value="@SelectedManufacturingActivity.MaterialGroupFactor" 
DecimalPlaces=2 Minimum="0" Outlined="true" Step="0.01m" Format="F"
Class="margin-top-5"></MatNumericUpDownField>

the right display: @SelectedManufacturingActivity.MaterialGroupFactor.ToString("F",CultureInfo.InstalledUICulture)

1

There are 1 best solutions below

0
On

It seems to me that the field type is missing, so the control doesn't 'know' to display in a currency format.

Try to add this property:

FieldType="MatNumericUpDownFieldType.Currency"