Is there a way to use EjsNumericTextBox binded to double value.
Whatever I did try to construct EjsNumericTextBox to use decimal values , binded value always getting integer number without decimal pointer.
My culture is set to HR (Croatian) and I am trying to set , (comma) as decimal pointer.
I am using Blazor componets instaled by nuget version 17.4.0.39
Here is my one of my attempts to bind decimal.
@page "/NumericTest"
@using Syncfusion.EJ2.Blazor.Inputs
<EjsNumericTextBox TValue="double?"
Decimals="2"
Placeholder="Iznos računa"
Min="0"
Locale="hr"
@bind-Value="@iznos"
Format="C2"
></EjsNumericTextBox>
<hr />
<span >@( iznos.HasValue ? iznos.Value.ToString("0.00") : "Set value")</span>
@code {
[Inject]
protected IJSRuntime JsRuntime { get; set; }
private double? iznos { get; set; } = 12.34;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
this.JsRuntime.Ejs().LoadLocaleData("wwwroot/ej2-locale/src/hr.json").LoadCldrData("wwwroot/cldr-data/main/hr/numbers.json", "wwwroot/cldr-data/main/hr/timeZoneNames.json", "wwwroot/cldr-data/main/bs/ca-gregorian.json", "wwwroot/cldr-data/main/hr/currencies.json", "wwwroot/cldr-data/supplemental/numberingSystems.json").SetCulture("hr").SetCurrencyCode("HRK");
}
}
<link rel='nofollow' href="https://cdn.syncfusion.com/ej2/17.4.39/material.css" rel="stylesheet" />
<script src="https://cdn.syncfusion.com/ej2/17.4.39/dist/ej2.min.js"></script>
<script src="https://cdn.syncfusion.com/ej2/17.4.39/dist/ejs.interop.min.js"></script> |
|
|
|
In Blazor Server App, when you want to use double values in EjsNumericTextBox binded value always returns value as integer.
Looks like in version 17.4.50 binding decimal pointer now works ok.
Look like there is still bug with binding null value,