Answers for "define decimal C#"

C#
1

c# format decimal as currency

private decimal _amount;

public string FormattedAmount
{
    get { return string.Format("{0:C}", _amount); }
}
Posted by: Guest on October-21-2020
1

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);
    }
}
Posted by: Guest on October-21-2020
-1

Decimal Number Variable C#

float number = 8.1f;
Posted by: Guest on December-20-2020

C# Answers by Framework

Browse Popular Code Answers by Language