RegionInfo.CurrencySymbol プロパティ

定義

国/地域に関連付けられた通貨記号を取得します。

public:
 virtual property System::String ^ CurrencySymbol { System::String ^ get(); };
public virtual string CurrencySymbol { get; }
member this.CurrencySymbol : string
Public Overridable ReadOnly Property CurrencySymbol As String

プロパティ値

国/地域に関連付けられた通貨記号。

次のコード例では、 クラスのプロパティを RegionInfo 表示します。

using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Displays the property values of the RegionInfo for "US".
   RegionInfo^ myRI1 = gcnew RegionInfo( "US" );
   Console::WriteLine( "   Name:                         {0}", myRI1->Name );
   Console::WriteLine( "   DisplayName:                  {0}", myRI1->DisplayName );
   Console::WriteLine( "   EnglishName:                  {0}", myRI1->EnglishName );
   Console::WriteLine( "   IsMetric:                     {0}", myRI1->IsMetric );
   Console::WriteLine( "   ThreeLetterISORegionName:     {0}", myRI1->ThreeLetterISORegionName );
   Console::WriteLine( "   ThreeLetterWindowsRegionName: {0}", myRI1->ThreeLetterWindowsRegionName );
   Console::WriteLine( "   TwoLetterISORegionName:       {0}", myRI1->TwoLetterISORegionName );
   Console::WriteLine( "   CurrencySymbol:               {0}", myRI1->CurrencySymbol );
   Console::WriteLine( "   ISOCurrencySymbol:            {0}", myRI1->ISOCurrencySymbol );
}

/*
This code produces the following output.

   Name:                         US
   DisplayName:                  United States
   EnglishName:                  United States
   IsMetric:                     False
   ThreeLetterISORegionName:     USA
   ThreeLetterWindowsRegionName: USA
   TwoLetterISORegionName:       US
   CurrencySymbol:               $
   ISOCurrencySymbol:            USD

*/
using System;
using System.Globalization;

public class SamplesRegionInfo  {

   public static void Main()  {

      // Displays the property values of the RegionInfo for "US".
      RegionInfo myRI1 = new RegionInfo( "US" );
      Console.WriteLine( "   Name:                         {0}", myRI1.Name );
      Console.WriteLine( "   DisplayName:                  {0}", myRI1.DisplayName );
      Console.WriteLine( "   EnglishName:                  {0}", myRI1.EnglishName );
      Console.WriteLine( "   IsMetric:                     {0}", myRI1.IsMetric );
      Console.WriteLine( "   ThreeLetterISORegionName:     {0}", myRI1.ThreeLetterISORegionName );
      Console.WriteLine( "   ThreeLetterWindowsRegionName: {0}", myRI1.ThreeLetterWindowsRegionName );
      Console.WriteLine( "   TwoLetterISORegionName:       {0}", myRI1.TwoLetterISORegionName );
      Console.WriteLine( "   CurrencySymbol:               {0}", myRI1.CurrencySymbol );
      Console.WriteLine( "   ISOCurrencySymbol:            {0}", myRI1.ISOCurrencySymbol );
   }
}

/*
This code produces the following output.

   Name:                         US
   DisplayName:                  United States
   EnglishName:                  United States
   IsMetric:                     False
   ThreeLetterISORegionName:     USA
   ThreeLetterWindowsRegionName: USA
   TwoLetterISORegionName:       US
   CurrencySymbol:               $
   ISOCurrencySymbol:            USD

*/
Imports System.Globalization


Public Class SamplesRegionInfo   

   Public Shared Sub Main()

      ' Displays the property values of the RegionInfo for "US".
      Dim myRI1 As New RegionInfo("US")
      Console.WriteLine("   Name:                         {0}", myRI1.Name)
      Console.WriteLine("   DisplayName:                  {0}", myRI1.DisplayName)
      Console.WriteLine("   EnglishName:                  {0}", myRI1.EnglishName)
      Console.WriteLine("   IsMetric:                     {0}", myRI1.IsMetric)
      Console.WriteLine("   ThreeLetterISORegionName:     {0}", myRI1.ThreeLetterISORegionName)
      Console.WriteLine("   ThreeLetterWindowsRegionName: {0}", myRI1.ThreeLetterWindowsRegionName)
      Console.WriteLine("   TwoLetterISORegionName:       {0}", myRI1.TwoLetterISORegionName)
      Console.WriteLine("   CurrencySymbol:               {0}", myRI1.CurrencySymbol)
      Console.WriteLine("   ISOCurrencySymbol:            {0}", myRI1.ISOCurrencySymbol)

   End Sub

End Class


'This code produces the following output.
'
'   Name:                         US
'   DisplayName:                  United States
'   EnglishName:                  United States
'   IsMetric:                     False
'   ThreeLetterISORegionName:     USA
'   ThreeLetterWindowsRegionName: USA
'   TwoLetterISORegionName:       US
'   CurrencySymbol:               $
'   ISOCurrencySymbol:            USD

注釈

たとえば、米国の通貨記号は "$" です。

現在 RegionInfo のオブジェクトが特定のカルチャで作成され、対応する国/地域で複数の言語が使用されている場合、 CurrencySymbol プロパティは特定のカルチャに関連付けられている通貨記号を返します。

適用対象

こちらもご覧ください