c# tostring format 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# tostring currency
amount.ToString("C", CultureInfo.CurrentCulture)
Example 3: vb.net tostring numeric format string
decimal value = 123.456m;
Console.WriteLine("Your account balance is {0:C2}.", value);
// Displays "Your account balance is $123.46."