dotnet/aspnetcore

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

クローズ

#5,523 opened on 2018/05/17

 (33 件のコメント) (17 件のリアクション) (1 人の担当者)C# (10,653 件のフォーク)batch import
Pillar: Technical DebtPriority:2affected-mediumarea-blazorenhancementfeature-blazor-component-modelhelp wantedseverity-major

Repository metrics

Stars
 (37,933 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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)

コントリビューターガイド