Closed SvenVoeten closed 6 months ago
@SvenVoeten Were you able to replicate here: https://demos.blazorbootstrap.com/form/number-input#step
I'm not able to replicate the Issue. Please see the attached video. Let me know, If I'm missing something.
Also, provide the following details:
Web Assembly / Server: .NET Version: BlazorBootstrap Version:
@gvreddy04
Thanks for the fast response. I created an example project where you can see the issue. Just debug it as a windows app and jou should be able to reproduce the issue.
Web Assembly / Server: >NET MAUI Blazor App .NET Version: 7 BlazorBootstrap Version: 1.10.0
@SvenVoeten I don't see any issue with your code, and it is working as expected. Please see the attached video for reference. Just do a clean and build again. You can also try uninstalling the app from the local Windows Store and running it again.
@SvenVoeten maybe this has something todo with localization. Which language is your Windows running?
I think @MarvinKlein1508 is correct. I walk into the same problem with the CurrencyInput and the use of points and comma's which is used differently between language's. Diving into the code it looks like (in my language) the comma's is been ignored as an decimal seperator but later on translated into the locale format. This results in basically the same issue as @SvenVoeten has.
@Capellio Can you help me reproduce this issue by providing some steps?
@Capellio Can you help me reproduce this issue by providing some steps?
for example :
<CurrencyInput TValue="decimal" @bind-Value="@ProductAgreement.Price" Locale="nl-NL" />
This should allow the value "€ 12,59" which is a valid format for EU countries. However, the "," (comma) is not allowed as a valid character. At least, that is how I understand the following code from the component (method "ExtractValue").
The "SetFormattedValueAsync" method ignores the seperation characters, therefore the value is transformed into "€ 1259.00" (when we use nothing) or "€ 12.590" (when we use a point).
In both methods we should take into consideration the decimal- and thousendseperation character per locale.
Although @SvenVoeten has the issue with the NumericInput I think the same goes for CurrencyInput.
@Capellio Thank you for the detailed info. I'll check this.
Hi,
It seems that it indeed has to do with language settings.
Below you can see that I'm trying a point and a comma but both do nothing.
When I switch my language to english (United States) its working as expected. I can't even enther the comma.
@SvenVoeten What language you have on your machine?
@gvreddy04
Below a screenshot from my languages.
@SvenVoeten Thank you for the info. I'll test this.
@SvenVoeten
Please try the below approach and let me know.
<CurrencyInput TValue="decimal?" @bind-Value="@Price" Locale="nl-NL" />
@code{
private decimal? Price;
}
Hide currency symbol:
<CurrencyInput TValue="decimal?" @bind-Value="@Price" Locale="nl-NL" HideCurrencySymbol="true" />
@code{
private decimal? Price;
}
Hi i tried the last suggestion and still doesn't work. My locale is it-IT and with HideCurrencySymbol it doesn't work
This is indeed a bug. Can reproduce it with local de-de as well. I've created 2 PR's to fix both NumberInput
and CurrencyInput
.
With this patches both of them work fine for me in Server, WebAssembly & .NET MAUI.
Hi,
I'm trying to implement the NumberInput component in my project but was unable to use decimal values. So I copied the example demo code but this also doesn't work.
In the example below I inputted 2.5 and pressed enter, then the value is changed to 25. Also if I use the increase value arrow it icreases with 1 to 26.
Any idea on what I'm doing wrong?