NumberFormatInfo.CurrencySymbol Property

 

Gets or sets the string to use as the currency symbol.

Namespace:   System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

Public Property CurrencySymbol As String

Property Value

Type: System.String

The string to use as the currency symbol. The default for InvariantInfo is "¤".

Exception Condition
ArgumentNullException

The property is being set to null.

InvalidOperationException

The property is being set and the NumberFormatInfo object is read-only.

The string assigned to the CurrencySymbol property is included in the result string when a numeric value is formatted with the "C" standard numeric format string.

The following example displays the currency symbol for the current culture and uses the "C" standard numeric format string to format a currency value.

Imports System.Globalization
Imports System.Threading

Module Example
   Public Sub Main()
      Dim value As Decimal = 106.25d
      Console.WriteLine("Current Culture: {0}",
                        CultureInfo.CurrentCulture.Name)
      Console.WriteLine("Currency Symbol: {0}",
                        NumberFormatInfo.CurrentInfo.CurrencySymbol)
      Console.WriteLine("Currency Value:  {0:C2}", value)
   End Sub
End Module
' The example displays output like the following:
'       Current Culture: en-US
'       Currency Symbol: $
'       Currency Value:  $106.25

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: