, Nullable SQL Server Money :
, (c.AmountAgreedOn), , td, :
@{
string value = "";
decimal? decimalValue = c.AmountAgreedOn;
if (decimalValue.HasValue)
{
value = ((decimal)(decimalValue)).ToString("0.00");
<td align="center">@value</td>
}
else
{
<td align="center">@value</td>
}
}
, "" , .
.,, model.cs "AmountAgreedOn":
[DisplayFormat(ApplyFormatInEditMode = false, DataFormatString = "{0:c}")]
public Nullable<decimal> AmountAgreedOn { get; set; }
( , ), ApplyFormatInEditMode "true".
Not very, but I could not understand another way. I just don’t understand the mad scientist.
source
share