NumberFormatInfo

NumberFormatInfo class

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.

class NumberFormatInfo : public virtual System::Object,
                         public System::IFormatProvider,
                         public System::ICloneable

Methods

MethodDescription
SharedPtr<Object> Clone() overrideClones format info.
virtual bool Equals(ptr)Compares objects using C# Object.Equals semantics.
static std::enable_if<IsSmartPtr<T1>::value&&IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares reference type objects in C# style.
static std::enable_if<!IsSmartPtr<T1>::value&&!IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares value type objects in C# style.
static bool Equals(float const&, float const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
static bool Equals(double const&, double const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
virtual bool FastCast(const Details::FastRttiBase&, void **) constFor internal purposes only.
int get_CurrencyDecimalDigits() constGets number of currency decimal digits.
String get_CurrencyDecimalSeparator() constGets currency decimal separator.
String get_CurrencyGroupSeparator() constGets currency group separator.
ArrayPtr<int> get_CurrencyGroupSizes() constGets number of currency decimal digits per group.
int get_CurrencyNegativePattern() constGets currency negative pattern.
int get_CurrencyPositivePattern() constGets currency positive pattern.
String get_CurrencySymbol() constGets currency symbol.
static NumberFormatInfoPtr get_CurrentInfo()Gets current thread culture-defined number format info.
DigitShapes get_DigitSubstitution() constGets a value that specifies how to display shape of a digit.
static const NumberFormatInfoPtr& get_InvariantInfo()Gets invariant culture-defined number format info.
bool get_IsReadOnly() constChecks if format is read-only.
String get_NaNSymbol() constGets Not-a-Number symbol.
ArrayPtr<String> get_NativeDigits() constGets digits symbols (0 through 9).
String get_NegativeInfinitySymbol() constGets negative infinity symbol.
String get_NegativeSign() constGets negative sign.
int get_NumberDecimalDigits() constGets number of decimal digits.
String get_NumberDecimalSeparator() constGets decimal separator.
String get_NumberGroupSeparator() constGets number group separator.
ArrayPtr<int> get_NumberGroupSizes() constGets numbers of digits per group.
int get_NumberNegativePattern() constGets number negative pattern.
int get_PercentDecimalDigits() constGets number of decimal places in percent values.
String get_PercentDecimalSeparator() constGets decimal separator in percent values.
String get_PercentGroupSeparator() constGets group separator in percent values.
ArrayPtr<int> get_PercentGroupSizes() constGets numbers of digits per percent value group.
int get_PercentNegativePattern() constGets percent negative pattern.
int get_PercentPositivePattern() constGets percent positive pattern.
String get_PercentSymbol() constGets percent symbol.
String get_PerMilleSymbol() constGets permille symbol.
String get_PositiveInfinitySymbol() constGets positive infinity symbol.
String get_PositiveSign() constGets positive sign.
Detail::SmartPtrCounter * GetCounter()Gets reference counter data structure associated with the object.
SharedPtr<Object> GetFormat(const TypeInfo&) overrideGets formatter of specific type.
virtual int32_t GetHashCode() constAnalog of C# Object.GetHashCode() method. Enables hashing of custom objects.
static NumberFormatInfoPtr GetInstance(const IFormatProviderPtr&)Gets formatter associated with format provider.
virtual const TypeInfo& GetType() constGets actual type of object. Analog of C# System.Object.GetType() call.
virtual bool Is(const TypeInfo&) constCheck if object represents an instance of type described by targetType. Analog of C# ‘is’ operator.
virtual ptr MemberwiseClone() constAnalog of C# Object.MemberwiseClone() method. Enables cloning custom types.
NumberFormatInfo()Default constructor (invariant NumberFormatInfo).
Object()Creates object. Initializes all internal data structures.
Object(Object const&)Copy constructor. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
NumberFormatInfo& operator=(const NumberFormatInfo&)
Object& operator=(Object const&)Assignment operator. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
static NumberFormatInfoPtr ReadOnly(NumberFormatInfoPtr)Gets read-only version of formatter.
static bool ReferenceEquals(ptr const&, ptr const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, T const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, std::nullptr_t)Reference-compares value type object with nullptr.
bool ReferenceEquals(String const&, std::nullptr_t)Specialization of Object::ReferenceEquals for case of string and nullptr.
bool ReferenceEquals(String const&, String const&)Specialization of Object::ReferenceEquals for case of strings.
int RemovedSharedRefs(int)Decreases shared reference count by specified value.
void set_CurrencyDecimalDigits(int)Sets number of currency decimal digits.
void set_CurrencyDecimalSeparator(const String&)Sets currency decimal separator.
void set_CurrencyGroupSeparator(const String&)Sets currency group separator.
void set_CurrencyGroupSizes(const ArrayPtr<int>&)Sets number of currency decimal digits per group.
void set_CurrencyNegativePattern(int)Sets currency negative pattern.
void set_CurrencyPositivePattern(int)Sets currency positive pattern.
void set_CurrencySymbol(const String&)Sets currency symbol.
void set_DigitSubstitution(DigitShapes)Sets a value that specifies how to display shape of a digit.
void set_NaNSymbol(const String&)Sets Not-a-Number symbol.
void set_NativeDigits(const ArrayPtr<String>&)Sets digits symbols (0 through 9).
void set_NegativeInfinitySymbol(const String&)Sets negative infinity symbol.
void set_NegativeSign(const String&)Sets negative sign.
void set_NumberDecimalDigits(int)Sets number of decimal digits.
void set_NumberDecimalSeparator(const String&)Sets decimal separator.
void set_NumberGroupSeparator(const String&)Sets number group separator.
void set_NumberGroupSizes(const ArrayPtr<int>&)Sets numbers of digits per group.
void set_NumberNegativePattern(int)Sets number negative pattern.
void set_PercentDecimalDigits(int)Sets number of decimal places in percent values.
void set_PercentDecimalSeparator(const String&)Sets decimal separator in percent values.
void set_PercentGroupSeparator(const String&)Sets group separator in percent values.
void set_PercentGroupSizes(const ArrayPtr<int>&)Sets numbers of digits per percent value group.
void set_PercentNegativePattern(int)Sets percent negative pattern.
void set_PercentPositivePattern(int)Sets percent positive pattern.
void set_PercentSymbol(const String&)Sets percent symbol.
void set_PerMilleSymbol(const String&)Sets permille symbol.
void set_PositiveInfinitySymbol(const String&)Sets positive infinity symbol.
void set_PositiveSign(const String&)Sets positive sign.
virtual void SetTemplateWeakPtr(uint32_t)Set n’th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
int SharedCount() constGets current value of shared reference counter.
Object * SharedRefAdded()Increments shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
int SharedRefRemovedSafe()Decrements and returns shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual String ToString() constAnalog of C# Object.ToString() method. Enables converting custom objects to string.
static const TypeInfo& Type()Implements C# typeof(System.Object) construct.
void Unlock()Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
Detail::SmartPtrCounter * WeakRefAdded()Increments weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void WeakRefRemoved()Decrements weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual ~Object()Destroys object. Frees all internal data structures.

See Also