dotnet/aspnetcore

Add support for binding decimal, double, float data type with configurable formatting

Open

#5,523 建立於 2018年5月17日

在 GitHub 查看
 (33 留言) (17 反應) (1 負責人)C# (10,653 fork)batch import
Pillar: Technical DebtPriority:2affected-mediumarea-blazorenhancementfeature-blazor-component-modelhelp wantedseverity-major

倉庫指標

Star
 (37,933 star)
PR 合併指標
 (平均合併 16天 9小時) (30 天內合併 258 個 PR)

描述

This should work

<input @bind="@price"/>
@code
{
    decimal price;
}

but currently we get an exception: Error: System.ArgumentException: 'bind' does not accept values of type System.Decimal. To read and write this value type, wrap it in a property of type string with suitable getters and setters.

Decimal data type is paramount in every business application. We don't want to use "hacks" and convert it to/from string manually every time.

Support for formatting is also crucial (number of decimal places, decimal and thousandth separators)

貢獻者指南