c# format null decimal as currency code example
Example 1: c# format decimal as currency
private decimal _amount;
public string FormattedAmount
{
get { return string.Format("{0:C}", _amount); }
}
Example 2: c# format decimal as currency
private decimal? _amount;
// For nullable decimals
public string FormattedAmount
{
get
{
return _amount == null ? "null" : string.Format("{0:C}", _amount.Value);
}
}