Open fingers10 opened 3 years ago
Thanks for contacting us.
We're moving this issue to the Next sprint planning
milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Hello @fingers10. As you mentioned from the docs:
Data binding works with a single DateTime format string using @bind:format="{FORMAT STRING}", where the {FORMAT STRING} placeholder is the format string. Other format expressions, such as currency or number formats, aren't available at this time but might be added in a future release.
This is not currently planned, but we'll use this issue to track community interest for this feature.
My company is keen for bind format string support against numeric types, we currently have to do the formatting ourselves whenever we want specific precision on our floating point values. Being able to bind directly to the double with a format string would be great, especially since Blazor / the browser would then handle the localisation for us :)
<input type="number" @bind-value="@number" @bind-value:format="0.000000" />
Error (active) CS1503 Argument 1: cannot convert from 'double' to 'System.DateTime' ...
Very bad.
Describe the bug
Display Formatting doesn't work with
decimal
types in Blazor WebAssembly.To Reproduce
Notice the output as shown below:
@bind-value:format
doesn't seem to work. I have also tried with[DisplayFormat(DataFormatString = "{0:#.##}", ApplyFormatInEditMode = true)]
Data Annotation. This also doesn't work.Later from the docs I noticed that
Is there any plans on including this in preview release? Please can you share an update on this? Or is there any best workaround for this at the moment?
Further technical details
ASP.NET Core version - 5.0.3
Include the output of
dotnet --info
The IDE - VS 2019 16.8.6