NumberFormatInfo 클래스

정의

숫자 값을 서식 지정하고 구문 분석하는 문화권별 정보를 제공합니다.

public ref class NumberFormatInfo sealed : IFormatProvider
public ref class NumberFormatInfo sealed : ICloneable, IFormatProvider
public sealed class NumberFormatInfo : IFormatProvider
public sealed class NumberFormatInfo : ICloneable, IFormatProvider
[System.Serializable]
public sealed class NumberFormatInfo : ICloneable, IFormatProvider
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class NumberFormatInfo : ICloneable, IFormatProvider
type NumberFormatInfo = class
    interface IFormatProvider
type NumberFormatInfo = class
    interface ICloneable
    interface IFormatProvider
[<System.Serializable>]
type NumberFormatInfo = class
    interface ICloneable
    interface IFormatProvider
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type NumberFormatInfo = class
    interface ICloneable
    interface IFormatProvider
Public NotInheritable Class NumberFormatInfo
Implements IFormatProvider
Public NotInheritable Class NumberFormatInfo
Implements ICloneable, IFormatProvider
상속
NumberFormatInfo
특성
구현

예제

다음 예제에서는 검색 하는 방법을 보여 줍니다는 NumberFormatInfo 해당 하는 것에 대 한 개체 CultureInfo 개체 및 특정 문화권에 대 한 정보를 서식 지정 하는 쿼리 수를 검색된 된 개체를 사용 합니다.

using namespace System;
using namespace System::Globalization;
using namespace System::Text;

int main()
{
    StringBuilder^ builder = gcnew StringBuilder();

    // Loop through all the specific cultures known to the CLR.
    for each(CultureInfo^ culture in 
        CultureInfo::GetCultures (CultureTypes::SpecificCultures)) 
    {
        // Only show the currency symbols for cultures 
        // that speak English.
        if (culture->TwoLetterISOLanguageName == "en")
        {
            // Display the culture name and currency symbol.
            NumberFormatInfo^ numberFormat = culture->NumberFormat;
            builder->AppendFormat("The currency symbol for '{0}'"+
                "is '{1}'",culture->DisplayName,
                numberFormat->CurrencySymbol);
            builder->AppendLine();
        }
    }
    Console::WriteLine(builder);
}

// This code produces the following output.
//
// The currency symbol for 'English (United States)' is '$'
// The currency symbol for 'English (United Kingdom)' is 'Ј'
// The currency symbol for 'English (Australia)' is '$'
// The currency symbol for 'English (Canada)' is '$'
// The currency symbol for 'English (New Zealand)' is '$'
// The currency symbol for 'English (Ireland)' is '?'
// The currency symbol for 'English (South Africa)' is 'R'
// The currency symbol for 'English (Jamaica)' is 'J$'
// The currency symbol for 'English (Caribbean)' is '$'
// The currency symbol for 'English (Belize)' is 'BZ$'
// The currency symbol for 'English (Trinidad and Tobago)' is 'TT$'
// The currency symbol for 'English (Zimbabwe)' is 'Z$'
// The currency symbol for 'English (Republic of the Philippines)' is 'Php'
using System;
using System.Globalization;
using System.Text;

public sealed class App
{
    static void Main()
    {
        StringBuilder sb = new StringBuilder();

        // Loop through all the specific cultures known to the CLR.
        foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
        {
            // Only show the currency symbols for cultures that speak English.
            if (ci.TwoLetterISOLanguageName != "en") continue;

            // Display the culture name and currency symbol.
            NumberFormatInfo nfi = ci.NumberFormat;
            sb.AppendFormat("The currency symbol for '{0}' is '{1}'",
                ci.DisplayName, nfi.CurrencySymbol);
            sb.AppendLine();
        }
        Console.WriteLine(sb.ToString());
    }
}

// This code produces the following output.
//
// The currency symbol for 'English (United States)' is '$'
// The currency symbol for 'English (United Kingdom)' is '£'
// The currency symbol for 'English (Australia)' is '$'
// The currency symbol for 'English (Canada)' is '$'
// The currency symbol for 'English (New Zealand)' is '$'
// The currency symbol for 'English (Ireland)' is '?'
// The currency symbol for 'English (South Africa)' is 'R'
// The currency symbol for 'English (Jamaica)' is 'J$'
// The currency symbol for 'English (Caribbean)' is '$'
// The currency symbol for 'English (Belize)' is 'BZ$'
// The currency symbol for 'English (Trinidad and Tobago)' is 'TT$'
// The currency symbol for 'English (Zimbabwe)' is 'Z$'
// The currency symbol for 'English (Republic of the Philippines)' is 'Php'
Imports System.Globalization
Imports System.Text

Public Module Example
   Public Sub Main() 
      Dim sb As New StringBuilder()

      ' Loop through all the specific cultures known to the CLR.
      For Each ci In CultureInfo.GetCultures(CultureTypes.SpecificCultures) 
         ' Only show the currency symbols for cultures that speak English.
         If ci.TwoLetterISOLanguageName <> "en" Then Continue For

         ' Display the culture name and currency symbol.
         Dim nfi As NumberFormatInfo = ci.NumberFormat
         sb.AppendFormat("The currency symbol for '{0}' is '{1}'",
                         ci.DisplayName, nfi.CurrencySymbol)
         sb.AppendLine()
      Next
      Console.WriteLine(sb.ToString())
   End Sub
End Module
' The example displays output like the following:
'       The currency symbol for 'English (United States)' is '$'
'       The currency symbol for 'English (United Kingdom)' is '£'
'       The currency symbol for 'English (Australia)' is '$'
'       The currency symbol for 'English (Canada)' is '$'
'       The currency symbol for 'English (New Zealand)' is '$'
'       The currency symbol for 'English (Ireland)' is '?'
'       The currency symbol for 'English (South Africa)' is 'R'
'       The currency symbol for 'English (Jamaica)' is 'J$'
'       The currency symbol for 'English (Caribbean)' is '$'
'       The currency symbol for 'English (Belize)' is 'BZ$'
'       The currency symbol for 'English (Trinidad and Tobago)' is 'TT$'
'       The currency symbol for 'English (Zimbabwe)' is 'Z$'
'       The currency symbol for 'English (Republic of the Philippines)' is 'Php'
'       The currency symbol for 'English (India)' is 'Rs.'
'       The currency symbol for 'English (Malaysia)' is 'RM'
'       The currency symbol for 'English (Singapore)' is '$'

설명

이 API에 대한 자세한 내용은 NumberFormatInfo에 대한 추가 API 설명을 참조하세요.

생성자

NumberFormatInfo()

문화권 독립(고정)적인 NumberFormatInfo 클래스의 쓰기 가능한 새 인스턴스를 초기화합니다.

속성

CurrencyDecimalDigits

통화 값에 사용할 소수 자릿수를 가져오거나 설정합니다.

CurrencyDecimalSeparator

통화 값에서 소수 구분 기호로 사용하는 문자열을 가져오거나 설정합니다.

CurrencyGroupSeparator

통화 값에서 정수 부분을 구분하는 문자열을 가져오거나 설정합니다.

CurrencyGroupSizes

통화 값에서 정수 부분의 각 그룹 자릿수를 가져오거나 설정합니다.

CurrencyNegativePattern

음수 통화 값의 형식 패턴을 가져오거나 설정합니다.

CurrencyPositivePattern

양수 통화 값의 형식 패턴을 가져오거나 설정합니다.

CurrencySymbol

통화 기호로 사용할 문자열을 가져오거나 설정합니다.

CurrentInfo

현재 문화권에 따라 값의 서식을 지정하는 읽기 전용 NumberFormatInfo을(를) 가져옵니다.

DigitSubstitution

그래픽 사용자 인터페이스에서 숫자 모양을 표시하는 방법을 지정하는 값을 가져오거나 설정합니다.

InvariantInfo

문화권 독립(고정)적인 읽기 전용 NumberFormatInfo 개체를 가져옵니다.

IsReadOnly

NumberFormatInfo 개체가 읽기 전용인지 나타내는 값을 가져옵니다.

NaNSymbol

IEEE NaN(숫자 아님) 값을 나타내는 문자열을 가져오거나 설정합니다.

NativeDigits

서양식 숫자 0에서 9까지에 해당하는 기본 숫자의 문자열 배열을 가져오거나 설정합니다.

NegativeInfinitySymbol

음의 무한대를 나타내는 문자열을 가져오거나 설정합니다.

NegativeSign

관련 숫자가 음수임을 나타내는 문자열을 가져오거나 설정합니다.

NumberDecimalDigits

숫자 값에 사용하는 소수 자릿수를 가져오거나 설정합니다.

NumberDecimalSeparator

숫자 값에서 소수 구분 기호로 사용하는 문자열을 가져오거나 설정합니다.

NumberGroupSeparator

숫자 값에서 정수 부분을 구분하는 문자열을 가져오거나 설정합니다.

NumberGroupSizes

숫자 값에서 정수 부분의 각 그룹 자릿수를 가져오거나 설정합니다.

NumberNegativePattern

음수 숫자 값의 형식 패턴을 가져오거나 설정합니다.

PercentDecimalDigits

백분율 값에 사용할 소수 자릿수를 가져오거나 설정합니다.

PercentDecimalSeparator

백분율 값에서 소수 구분 기호로 사용할 문자열을 가져오거나 설정합니다.

PercentGroupSeparator

백분율 값에서 정수 부분을 구분하는 문자열을 가져오거나 설정합니다.

PercentGroupSizes

백분율 값에서 정수 부분의 각 그룹 자릿수를 가져오거나 설정합니다.

PercentNegativePattern

음수 백분율 값의 형식 패턴을 가져오거나 설정합니다.

PercentPositivePattern

양수 백분율 값의 형식 패턴을 가져오거나 설정합니다.

PercentSymbol

백분율 기호로 사용할 문자열을 가져오거나 설정합니다.

PerMilleSymbol

천분율 기호로 사용할 문자열을 가져오거나 설정합니다.

PositiveInfinitySymbol

양의 무한대를 나타내는 문자열을 가져오거나 설정합니다.

PositiveSign

관련 숫자가 양수임을 나타내는 문자열을 가져오거나 설정합니다.

메서드

Clone()

NumberFormatInfo 개체의 부분 복사본을 만듭니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetFormat(Type)

숫자 서식 지정 서비스를 제공하는 지정된 형식의 개체를 가져옵니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetInstance(IFormatProvider)

지정된 NumberFormatInfo에 연결된 IFormatProvider를 가져옵니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ReadOnly(NumberFormatInfo)

읽기 전용 NumberFormatInfo 래퍼를 반환합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보