System::Globalization::NumberFormatInfo Class Referencefinal

Inherits System::Object, System::IFormatProvider, and System::ICloneable.

Public Member Functions

bool get_IsReadOnly () const
 
SharedPtr< ObjectClone () override
 
String get_NumberDecimalSeparator () const
 
void set_NumberDecimalSeparator (const String &value)
 
int get_NumberDecimalDigits () const
 
void set_NumberDecimalDigits (int value)
 
String get_NumberGroupSeparator () const
 
void set_NumberGroupSeparator (const String &value)
 
String get_PercentSymbol () const
 
void set_PercentSymbol (const String &value)
 
String get_PerMilleSymbol () const
 
void set_PerMilleSymbol (const String &value)
 
String get_CurrencySymbol () const
 
void set_CurrencySymbol (const String &value)
 
String get_PositiveSign () const
 
void set_PositiveSign (const String &value)
 
String get_NegativeSign () const
 
void set_NegativeSign (const String &value)
 
String get_CurrencyGroupSeparator () const
 
void set_CurrencyGroupSeparator (const String &value)
 
String get_CurrencyDecimalSeparator () const
 
void set_CurrencyDecimalSeparator (const String &value)
 
int get_CurrencyDecimalDigits () const
 
void set_CurrencyDecimalDigits (int value)
 
ArrayPtr< int > get_CurrencyGroupSizes () const
 
void set_CurrencyGroupSizes (const ArrayPtr< int > &value)
 
int get_CurrencyNegativePattern () const
 
void set_CurrencyNegativePattern (int value)
 
int get_CurrencyPositivePattern () const
 
void set_CurrencyPositivePattern (int value)
 
String get_NaNSymbol () const
 
void set_NaNSymbol (const String &value)
 
String get_PositiveInfinitySymbol () const
 
void set_PositiveInfinitySymbol (const String &value)
 
String get_NegativeInfinitySymbol () const
 
void set_NegativeInfinitySymbol (const String &value)
 
ArrayPtr< int > get_NumberGroupSizes () const
 
void set_NumberGroupSizes (const ArrayPtr< int > &value)
 
int get_NumberNegativePattern () const
 
void set_NumberNegativePattern (int value)
 
int get_PercentDecimalDigits () const
 
void set_PercentDecimalDigits (int value)
 
String get_PercentDecimalSeparator () const
 
void set_PercentDecimalSeparator (const String &value)
 
String get_PercentGroupSeparator () const
 
void set_PercentGroupSeparator (const String &value)
 
ArrayPtr< int > get_PercentGroupSizes () const
 
void set_PercentGroupSizes (const ArrayPtr< int > &value)
 
int get_PercentNegativePattern () const
 
void set_PercentNegativePattern (int value)
 
int get_PercentPositivePattern () const
 
void set_PercentPositivePattern (int value)
 
ArrayPtr< Stringget_NativeDigits () const
 
void set_NativeDigits (const ArrayPtr< String > &value)
 
DigitShapes get_DigitSubstitution () const
 
void set_DigitSubstitution (DigitShapes value)
 
SharedPtr< ObjectGetFormat (const TypeInfo &format_type) override
 
NumberFormatInfooperator= (const NumberFormatInfo &)=delete
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Static Public Member Functions

static NumberFormatInfoPtr get_CurrentInfo ()
 
static const NumberFormatInfoPtrget_InvariantInfo ()
 
static NumberFormatInfoPtr GetInstance (const IFormatProviderPtr &provider)
 
static NumberFormatInfoPtr ReadOnly (NumberFormatInfoPtr nfi)
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 

Detailed Description

Holds information on how to format numbers. Setter operations are only enabled on non-read-only objects. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Member Function Documentation

◆ Clone()

SharedPtr<Object> System::Globalization::NumberFormatInfo::Clone ( )
overridevirtual

Clones format info.

Returns
New object copied from the current NumberFormatInfo.

Implements System::ICloneable.

◆ get_CurrencyDecimalDigits()

int System::Globalization::NumberFormatInfo::get_CurrencyDecimalDigits ( ) const

Gets number of currency decimal digits.

Returns
Number of currency decimal digits.

◆ get_CurrencyDecimalSeparator()

String System::Globalization::NumberFormatInfo::get_CurrencyDecimalSeparator ( ) const

Gets currency decimal separator.

Returns
Currency decimal separator.

◆ get_CurrencyGroupSeparator()

String System::Globalization::NumberFormatInfo::get_CurrencyGroupSeparator ( ) const

Gets currency group separator.

Returns
Currency group separator.

◆ get_CurrencyGroupSizes()

ArrayPtr<int> System::Globalization::NumberFormatInfo::get_CurrencyGroupSizes ( ) const

Gets number of currency decimal digits per group.

Returns
Number of currency decimal digits per group.

◆ get_CurrencyNegativePattern()

int System::Globalization::NumberFormatInfo::get_CurrencyNegativePattern ( ) const

Gets currency negative pattern.

Returns
Index of the pattern in array {"($n)", "-$n", "$-n", "$n-", "(n$)", "-n$", "n-$", "n$-", "-n $", "-$ n", "n $-", "$ n-", "$ -n", "n- $", "($ n)", "(n $)"}, where "n" is number, "-" is minus sign and "$" is currency symbol.

◆ get_CurrencyPositivePattern()

int System::Globalization::NumberFormatInfo::get_CurrencyPositivePattern ( ) const

Gets currency positive pattern.

Returns
Index of the pattern in array {"$n", "n$", "$ n", "n $"}, where "n" is number and "$" is currency symbol.

◆ get_CurrencySymbol()

String System::Globalization::NumberFormatInfo::get_CurrencySymbol ( ) const

Gets currency symbol.

Returns
Currency symbol.

◆ get_CurrentInfo()

static NumberFormatInfoPtr System::Globalization::NumberFormatInfo::get_CurrentInfo ( )
static

Gets current thread culture-defined number format info.

Returns
Format info object.

◆ get_DigitSubstitution()

DigitShapes System::Globalization::NumberFormatInfo::get_DigitSubstitution ( ) const

Gets a value that specifies how to display shape of a digit.

Returns
Value that specifies how to display shape of a digit.

◆ get_InvariantInfo()

static const NumberFormatInfoPtr& System::Globalization::NumberFormatInfo::get_InvariantInfo ( )
static

Gets invariant culture-defined number format info.

Returns
Format info object.

◆ get_IsReadOnly()

bool System::Globalization::NumberFormatInfo::get_IsReadOnly ( ) const

Checks if format is read-only.

Returns
True if format is read-only, false otherwise.

◆ get_NaNSymbol()

String System::Globalization::NumberFormatInfo::get_NaNSymbol ( ) const

Gets Not-a-Number symbol.

Returns
Not-a-Number symbol.

◆ get_NativeDigits()

ArrayPtr<String> System::Globalization::NumberFormatInfo::get_NativeDigits ( ) const

Gets digits symbols (0 through 9).

Returns
Array of digit symbols.

◆ get_NegativeInfinitySymbol()

String System::Globalization::NumberFormatInfo::get_NegativeInfinitySymbol ( ) const

Gets negative infinity symbol.

Returns
Negative infinity symbol.

◆ get_NegativeSign()

String System::Globalization::NumberFormatInfo::get_NegativeSign ( ) const

Gets negative sign.

Returns
Negative sign.

◆ get_NumberDecimalDigits()

int System::Globalization::NumberFormatInfo::get_NumberDecimalDigits ( ) const

Gets number of decimal digits.

Returns
Number of digits.

◆ get_NumberDecimalSeparator()

String System::Globalization::NumberFormatInfo::get_NumberDecimalSeparator ( ) const

Gets decimal separator.

Returns
Decimal separator.

◆ get_NumberGroupSeparator()

String System::Globalization::NumberFormatInfo::get_NumberGroupSeparator ( ) const

Gets number group separator.

Returns
Group separator.

◆ get_NumberGroupSizes()

ArrayPtr<int> System::Globalization::NumberFormatInfo::get_NumberGroupSizes ( ) const

Gets numbers of digits per group.

Returns
Array of digits per group, left to right; each element must be 1 to 9, last one can be 0 which means "combine all"; last element repeats.

◆ get_NumberNegativePattern()

int System::Globalization::NumberFormatInfo::get_NumberNegativePattern ( ) const

Gets number negative pattern.

Returns
Index of the pattern in array {"(n)", "-n", "- n", "n-", "n -"}, where "n" is number and "-" is minus sign.

◆ get_PercentDecimalDigits()

int System::Globalization::NumberFormatInfo::get_PercentDecimalDigits ( ) const

Gets number of decimal places in percent values.

Returns
Number of decimal places in percent values.

◆ get_PercentDecimalSeparator()

String System::Globalization::NumberFormatInfo::get_PercentDecimalSeparator ( ) const

Gets decimal separator in percent values.

Returns
Decimal separator in percent values.

◆ get_PercentGroupSeparator()

String System::Globalization::NumberFormatInfo::get_PercentGroupSeparator ( ) const

Gets group separator in percent values.

Returns
Group separator in percent values.

◆ get_PercentGroupSizes()

ArrayPtr<int> System::Globalization::NumberFormatInfo::get_PercentGroupSizes ( ) const

Gets numbers of digits per percent value group.

Returns
Array of digits per group, left to right; each element must be 1 to 9, last one can be 0 which means "combine all"; last element repeats.

◆ get_PercentNegativePattern()

int System::Globalization::NumberFormatInfo::get_PercentNegativePattern ( ) const

Gets percent negative pattern.

Returns
Index of the pattern in array {"-n %", "-n%", "-%n", "%-n", "%n-", "n-%", "n%-", "-% n", "n %-", "% n-", "% -n", "n- %"}, where "n" is number, "%" is percent sign and "-" is minus sign.

◆ get_PercentPositivePattern()

int System::Globalization::NumberFormatInfo::get_PercentPositivePattern ( ) const

Gets percent positive pattern.

Returns
Index of the pattern in array {"n %", "n%", "%n", "% n"}, where "n" is number and "%" is percent sign.

◆ get_PercentSymbol()

String System::Globalization::NumberFormatInfo::get_PercentSymbol ( ) const

Gets percent symbol.

Returns
Percent symbol.

◆ get_PerMilleSymbol()

String System::Globalization::NumberFormatInfo::get_PerMilleSymbol ( ) const

Gets permille symbol.

Returns
Permille symbol.

◆ get_PositiveInfinitySymbol()

String System::Globalization::NumberFormatInfo::get_PositiveInfinitySymbol ( ) const

Gets positive infinity symbol.

Returns
Positive infinity symbol.

◆ get_PositiveSign()

String System::Globalization::NumberFormatInfo::get_PositiveSign ( ) const

Gets positive sign.

Returns
Positive sign.

◆ GetFormat()

SharedPtr<Object> System::Globalization::NumberFormatInfo::GetFormat ( const TypeInfo format_type)
overridevirtual

Gets formatter of specific type.

Parameters
format_typeType of formatter to get; only NumberFormatInfo type is supported.
Returns
Formatter or null if not availsable.

Implements System::IFormatProvider.

◆ GetInstance()

static NumberFormatInfoPtr System::Globalization::NumberFormatInfo::GetInstance ( const IFormatProviderPtr provider)
static

Gets formatter associated with format provider.

Parameters
providerProvider to get format for.
Returns
Formatter associated with format provider or current thread's format if unavailable.

◆ operator=()

NumberFormatInfo& System::Globalization::NumberFormatInfo::operator= ( const NumberFormatInfo )
delete

◆ ReadOnly()

static NumberFormatInfoPtr System::Globalization::NumberFormatInfo::ReadOnly ( NumberFormatInfoPtr  nfi)
static

Gets read-only version of formatter.

Parameters
nfiFormatter to get read-only version of.
Returns
if nfi is read-only, returns it, otherwise creates a copy of it and marks it as read-only.

◆ set_CurrencyDecimalDigits()

void System::Globalization::NumberFormatInfo::set_CurrencyDecimalDigits ( int  value)

Sets number of currency decimal digits.

Parameters
valueNumber of currency decimal digits.

◆ set_CurrencyDecimalSeparator()

void System::Globalization::NumberFormatInfo::set_CurrencyDecimalSeparator ( const String value)

Sets currency decimal separator.

Parameters
valueCurrency decimal separator.

◆ set_CurrencyGroupSeparator()

void System::Globalization::NumberFormatInfo::set_CurrencyGroupSeparator ( const String value)

Sets currency group separator.

Parameters
valueCurrency group separator.

◆ set_CurrencyGroupSizes()

void System::Globalization::NumberFormatInfo::set_CurrencyGroupSizes ( const ArrayPtr< int > &  value)

Sets number of currency decimal digits per group.

Parameters
valueNumber of currency decimal digits per group.

◆ set_CurrencyNegativePattern()

void System::Globalization::NumberFormatInfo::set_CurrencyNegativePattern ( int  value)

Sets currency negative pattern.

Parameters
valueIndex of the pattern in array {"($n)", "-$n", "$-n", "$n-", "(n$)", "-n$", "n-$", "n$-", "-n $", "-$ n", "n $-", "$ n-", "$ -n", "n- $", "($ n)", "(n $)"}, where "n" is number, "-" is minus sign and "$" is currency symbol.

◆ set_CurrencyPositivePattern()

void System::Globalization::NumberFormatInfo::set_CurrencyPositivePattern ( int  value)

Sets currency positive pattern.

Parameters
valueIndex of the pattern in array {"$n", "n$", "$ n", "n $"}, where "n" is number and "$" is currency symbol.

◆ set_CurrencySymbol()

void System::Globalization::NumberFormatInfo::set_CurrencySymbol ( const String value)

Sets currency symbol.

Parameters
valueCurrency symbol.

◆ set_DigitSubstitution()

void System::Globalization::NumberFormatInfo::set_DigitSubstitution ( DigitShapes  value)

Sets a value that specifies how to display shape of a digit.

Parameters
valueValue that specifies how to display shape of a digit.

◆ set_NaNSymbol()

void System::Globalization::NumberFormatInfo::set_NaNSymbol ( const String value)

Sets Not-a-Number symbol.

Parameters
valueNot-a-Number symbol.

◆ set_NativeDigits()

void System::Globalization::NumberFormatInfo::set_NativeDigits ( const ArrayPtr< String > &  value)

Sets digits symbols (0 through 9).

Parameters
valueArray of digit symbols.

◆ set_NegativeInfinitySymbol()

void System::Globalization::NumberFormatInfo::set_NegativeInfinitySymbol ( const String value)

Sets negative infinity symbol.

Parameters
valueNegative infinity symbol.

◆ set_NegativeSign()

void System::Globalization::NumberFormatInfo::set_NegativeSign ( const String value)

Sets negative sign.

Parameters
valueNegative sign.

◆ set_NumberDecimalDigits()

void System::Globalization::NumberFormatInfo::set_NumberDecimalDigits ( int  value)

Sets number of decimal digits.

Parameters
valueNumber of digits.

◆ set_NumberDecimalSeparator()

void System::Globalization::NumberFormatInfo::set_NumberDecimalSeparator ( const String value)

Sets decimal separator.

Parameters
valueDecimal separator.

◆ set_NumberGroupSeparator()

void System::Globalization::NumberFormatInfo::set_NumberGroupSeparator ( const String value)

Sets number group separator.

Parameters
valueGroup separator.

◆ set_NumberGroupSizes()

void System::Globalization::NumberFormatInfo::set_NumberGroupSizes ( const ArrayPtr< int > &  value)

Sets numbers of digits per group.

Parameters
valueArray of digits per group, left to right; each element must be 1 to 9, last one can be 0 which means "combine all"; last element repeats.

◆ set_NumberNegativePattern()

void System::Globalization::NumberFormatInfo::set_NumberNegativePattern ( int  value)

Sets number negative pattern.

Parameters
valueIndex of the pattern in array {"(n)", "-n", "- n", "n-", "n -"}, where "n" is number and "-" is minus sign.

◆ set_PercentDecimalDigits()

void System::Globalization::NumberFormatInfo::set_PercentDecimalDigits ( int  value)

Sets number of decimal places in percent values.

Parameters
valueNumber of decimal places in percent values.

◆ set_PercentDecimalSeparator()

void System::Globalization::NumberFormatInfo::set_PercentDecimalSeparator ( const String value)

Sets decimal separator in percent values.

Parameters
valueDecimal separator in percent values.

◆ set_PercentGroupSeparator()

void System::Globalization::NumberFormatInfo::set_PercentGroupSeparator ( const String value)

Sets group separator in percent values.

Parameters
valueGroup separator in percent values.

◆ set_PercentGroupSizes()

void System::Globalization::NumberFormatInfo::set_PercentGroupSizes ( const ArrayPtr< int > &  value)

Sets numbers of digits per percent value group.

Parameters
valueArray of digits per group, left to right; each element must be 1 to 9, last one can be 0 which means "combine all"; last element repeats.

◆ set_PercentNegativePattern()

void System::Globalization::NumberFormatInfo::set_PercentNegativePattern ( int  value)

Sets percent negative pattern.

Parameters
valueIndex of the pattern in array {"-n %", "-n%", "-%n", "%-n", "%n-", "n-%", "n%-", "-% n", "n %-", "% n-", "% -n", "n- %"}, where "n" is number, "%" is percent sign and "-" is minus sign.

◆ set_PercentPositivePattern()

void System::Globalization::NumberFormatInfo::set_PercentPositivePattern ( int  value)

Sets percent positive pattern.

Parameters
valueIndex of the pattern in array {"n %", "n%", "%n", "% n"}, where "n" is number and "%" is percent sign.

◆ set_PercentSymbol()

void System::Globalization::NumberFormatInfo::set_PercentSymbol ( const String value)

Sets percent symbol.

Parameters
valuePercent symbol.

◆ set_PerMilleSymbol()

void System::Globalization::NumberFormatInfo::set_PerMilleSymbol ( const String value)

Sets permille symbol.

Parameters
valuePermille symbol.

◆ set_PositiveInfinitySymbol()

void System::Globalization::NumberFormatInfo::set_PositiveInfinitySymbol ( const String value)

Sets positive infinity symbol.

Parameters
valuePositive infinity symbol.

◆ set_PositiveSign()

void System::Globalization::NumberFormatInfo::set_PositiveSign ( const String value)

Sets positive sign.

Parameters
valuePositive sign.