Struct NSNumberFormatter

Source
#[repr(C)]
pub struct NSNumberFormatter { pub ptr: Id<Object>, }
Expand description

A formatter that converts between numeric values and their textual representations.

Fields§

§ptr: Id<Object>

The raw pointer to the Objective-C object.

Implementations§

Source§

impl NSNumberFormatter

Source

pub fn formatter_behavior(&self) -> NSNumberFormatterBehavior

The formatter behavior of the receiver.

Source

pub fn set_formatter_behavior(&mut self, behavior: NSNumberFormatterBehavior)

The formatter behavior of the receiver.

Source

pub fn set_default_formatter_behavior(behavior: NSNumberFormatterBehavior)

Sets the default formatter behavior for new instances of NSNumberFormatter.

Source

pub fn default_formatter_behavior() -> NSNumberFormatterBehavior

Returns an NSNumberFormatterBehavior constant that indicates default formatter behavior for new instances of NSNumberFormatter.

Source

pub fn number_style(&self) -> NSNumberFormatterStyle

The number style used by the receiver.

Source

pub fn set_number_style(&mut self, style: NSNumberFormatterStyle)

The number style used by the receiver.

Source

pub fn generates_decimal_numbers(&self)

Determines whether the receiver creates instances of super::NSDecimalNumber when it converts strings to number objects.

Source

pub fn get_object_value_for_string_range_error( &self, obj: id, string: NSString, rangep: NSRange, error: NSError, ) -> bool

Returns by reference a cell-content object after creating it from a range of characters in a given string.

Source

pub fn number_from_string(&self, string: NSString) -> NSNumber

Returns an NSNumber object created by parsing a given string.

Source

pub fn string_from_number(&self, number: NSNumber) -> NSString

Returns a string containing the formatted value of the provided number object.

Source

pub fn localized_string_from_number_number_style( num: NSNumber, nstyle: NSNumberFormatterStyle, ) -> NSString

Returns a localized number string with the specified style.

Source

pub fn localizes_format(&self) -> bool

Determines whether the dollar sign character ($), decimal separator character (.), and thousand separator character (,) are converted to appropriately localized characters as specified by the user’s localization preference.

Source

pub fn set_localizes_format(&mut self, localizes_format: bool)

Sets whether the dollar sign character ($), decimal separator character (.), and thousand separator character (,) are converted to appropriately localized characters as specified by the user’s localization preference.

Source

pub fn locale(&self) -> NSLocale

The locale of the receiver.

Source

pub fn set_locale(&mut self, locale: NSLocale)

Sets the locale of the receiver.

Source

pub fn rounding_behavior(&self) -> NSDecimalNumberHandler

The rounding behavior used by the receiver.

Source

pub fn set_rounding_behavior(&mut self, behavior: NSNumberFormatterBehavior)

Set the rounding behavior used by the receiver.

Source

pub fn rounding_increment(&self) -> NSNumber

The rounding increment used by the receiver.

Source

pub fn set_rounding_increment(&mut self, number: NSNumber)

The rounding increment used by the receiver.

Source

pub fn rounding_mode(&self) -> NSNumberFormatterRoundingMode

The rounding mode used by the receiver.

Source

pub fn set_rounding_mode(&mut self, mode: NSNumberFormatterRoundingMode)

The rounding mode used by the receiver.

Source

pub fn minimum_integer_digits(&self) -> UInt

The minimum number of digits before the decimal separator.

Source

pub fn set_minimum_integer_digits(&mut self, min: UInt)

Sets the minimum number of digits before the decimal separator.

§Example
use rust_macios::objective_c_runtime::traits::PNSObject;
use rust_macios::foundation::NSNumberFormatter;

let mut number_formatter = NSNumberFormatter::m_new();

number_formatter.set_minimum_integer_digits(0); // default
assert_eq!(number_formatter.string_from_number(123.into()), "123");

number_formatter.set_minimum_integer_digits(5);
assert_eq!(number_formatter.string_from_number(123.into()), "00123");
Source

pub fn maximum_integer_digits(&self) -> UInt

The maximum number of digits before the decimal separator.

Source

pub fn set_maximum_integer_digits(&mut self, max: UInt)

The maximum number of digits before the decimal separator.

§Example
use rust_macios::objective_c_runtime::traits::PNSObject;
use rust_macios::foundation::NSNumberFormatter;

let mut number_formatter = NSNumberFormatter::m_new();

number_formatter.set_maximum_integer_digits(42); // default
assert_eq!(number_formatter.string_from_number(12345.into()), "12345");

number_formatter.set_maximum_integer_digits(3);
assert_eq!(number_formatter.string_from_number(12345.into()), "345");
Source

pub fn minimum_fraction_digits(&self) -> UInt

The minimum number of digits after the decimal separator.

Source

pub fn set_minimum_fraction_digits(&mut self, min: UInt)

Sets the minimum number of digits after the decimal separator.

§Example
use rust_macios::objective_c_runtime::traits::PNSObject;
use rust_macios::foundation::NSNumberFormatter;

let mut number_formatter = NSNumberFormatter::m_new();

number_formatter.set_minimum_fraction_digits(0); // default
assert_eq!(number_formatter.string_from_number(123.456.into()), "123");

number_formatter.set_minimum_fraction_digits(5);
assert_eq!(number_formatter.string_from_number(123.456.into()), "123.45600");
Source

pub fn maximum_fraction_digits(&self) -> UInt

The maximum number of digits after the decimal separator.

Source

pub fn set_maximum_fraction_digits(&mut self, max: UInt)

Sets the maximum number of digits after the decimal separator.

§Example
use rust_macios::objective_c_runtime::traits::PNSObject;
use rust_macios::foundation::NSNumberFormatter;

let mut number_formatter = NSNumberFormatter::m_new();

number_formatter.set_maximum_fraction_digits(0); // default
assert_eq!(number_formatter.string_from_number(123.456.into()), "123");

number_formatter.set_maximum_fraction_digits(3);
assert_eq!(number_formatter.string_from_number(123.456789.into()), "123.457");
Source

pub fn uses_significant_digits(&self) -> bool

A Boolean value indicating whether the formatter uses minimum and maximum significant digits when formatting numbers.

Source

pub fn set_uses_significant_digits(&mut self, uses: bool)

A Boolean value indicating whether the formatter uses minimum and maximum significant digits when formatting numbers.

§Example
use rust_macios::objective_c_runtime::traits::PNSObject;
use rust_macios::foundation::NSNumberFormatter;

let mut number_formatter = NSNumberFormatter::m_new();

// Using significant digits
number_formatter.set_uses_significant_digits(true);
assert_eq!(number_formatter.string_from_number(12345678.into()), "12345700");
assert_eq!(number_formatter.string_from_number(1234.5678.into()), "1234.57");
assert_eq!(number_formatter.string_from_number(100.2345678.into()), "100.235");
assert_eq!(number_formatter.string_from_number(1.230000.into()), "1.23");
assert_eq!(number_formatter.string_from_number(0.00000123.into()), "0.00000123");

// Using integer and fraction digits
number_formatter.set_uses_significant_digits(false);
assert_eq!(number_formatter.string_from_number(12345678.into()), "12345678");
assert_eq!(number_formatter.string_from_number(1234.5678.into()), "1235");
assert_eq!(number_formatter.string_from_number(100.2345678.into()), "100");
assert_eq!(number_formatter.string_from_number(1.230000.into()), "1");
assert_eq!(number_formatter.string_from_number(0.00000123.into()), "0");
Source

pub fn minimum_significant_digits(&self) -> UInt

The minimum number of significant digits for the number formatter.

Source

pub fn set_minimum_significant_digits(&self, min: UInt)

Sets the minimum number of significant digits for the number formatter.

Source

pub fn maximum_significant_digits(&self) -> UInt

The maximum number of significant digits for the number formatter.

Source

pub fn set_maximum_significant_digits(&self, max: UInt)

Sets the maximum number of significant digits for the number formatter.

Source

pub fn format(&self) -> NSString

The receiver’s format.

Source

pub fn set_format(&mut self, format: NSString)

Sets the receiver’s format.

Source

pub fn formatting_context(&self) -> NSFormattingContext

The capitalization formatting context used when formatting a number.

Source

pub fn set_formatting_context(&mut self, context: NSFormattingContext)

Sets the capitalization formatting context used when formatting a number.

Source

pub fn format_width(&self) -> UInt

The format width used by the receiver.

Source

pub fn set_format_width(&mut self, width: UInt)

Sets the format width used by the receiver.

Source

pub fn negative_format(&self) -> NSString

The format the receiver uses to display negative values.

Source

pub fn set_negative_format(&mut self)

Sets the format the receiver uses to display negative values.

Source

pub fn positive_format(&self) -> NSString

The format the receiver uses to display positive values.

Source

pub fn set_positive_format(&mut self, format: NSString)

Sets the format the receiver uses to display positive values.

Source

pub fn multiplier(&self) -> NSNumber

The multiplier of the receiver.

Source

pub fn set_multiplier(&mut self, multiplier: NSNumber)

Sets the multiplier of the receiver.

Source

pub fn percent_symbol(&self) -> NSString

The string used to represent a percent symbol.

Source

pub fn set_percent_symbol(&mut self, symbol: NSString)

Sets the string used to represent a percent symbol.

Source

pub fn per_mill_symbol(&self) -> NSString

The string used to represent a per-mill (per-thousand) symbol.

Source

pub fn set_per_mill_symbol(&mut self, symbol: NSString)

The string used to represent a per-mill (per-thousand) symbol.

Source

pub fn minus_sign(&self) -> NSString

The string used to represent a minus sign.

Source

pub fn set_minus_sign(&mut self, sign: NSString)

Sets the string used to represent a minus sign.

Source

pub fn plus_sign(&self) -> NSString

The string used to represent a plus sign.

Source

pub fn set_plus_sign(&mut self, sign: NSString)

Sets the string used to represent a plus sign.

Source

pub fn exponent_symbol(&self) -> NSString

The string used to represent an exponent symbol.

Source

pub fn set_exponent_symbol(&mut self, sign: NSString)

Sets the string used to represent an exponent symbol.

Source

pub fn zero_symbol(&self) -> NSString

The string used to represent a zero symbol.

Source

pub fn set_zero_symbol(&mut self, sign: NSString)

Sets the string used to represent a zero symbol.

Source

pub fn nil_symbol(&self) -> NSString

The string used to represent a nil symbol.

Source

pub fn set_nil_symbol(&mut self, sign: NSString)

Sets the string used to represent a nil symbol.

Source

pub fn not_a_number_symbol(&self) -> NSString

The string used to represent a NaN (“not a number”) value.

Source

pub fn set_not_a_number_symbol(&mut self, symbol: NSString)

Sets the string used to represent a NaN (“not a number”) value.

Source

pub fn negative_infinity_symbol(&self) -> NSString

The string used to represent a negative infinity symbol.

Source

pub fn set_negative_infinity_symbol(&self, symbol: NSString)

Sets the string used to represent a negative infinity symbol.

Source

pub fn positive_infinity_symbol(&self) -> NSString

The string used to represent a positive infinity symbol.

Source

pub fn set_positive_infinity_symbol(&self, symbol: NSString)

Sets the string used to represent a positive infinity symbol.

Source

pub fn currency_symbol(&self) -> NSString

The string used by the receiver as a local currency symbol.

Source

pub fn set_currency_symbol(&mut self, symbol: NSString)

Sets the string used by the receiver as a local currency symbol.

Source

pub fn currency_code(&self) -> NSString

The receiver’s currency code.

Source

pub fn set_currency_code(&mut self, code: NSString)

Sets the receiver’s currency code.

Source

pub fn international_currency_symbol(&self) -> NSString

The international currency symbol used by the receiver.

Source

pub fn set_international_currency_symbol(&mut self, symbol: NSString)

Sets the international currency symbol used by the receiver.

Source

pub fn currency_grouping_separator(&self) -> NSString

The currency grouping separator for the receiver.

Source

pub fn positive_prefix(&self) -> NSString

The string the receiver uses as the prefix for positive values.

Source

pub fn set_positive_prefix(&mut self, prefix: NSString)

Sets the string the receiver uses as the prefix for positive values.

Source

pub fn positive_suffix(&self) -> NSString

The string the receiver uses as the suffix for positive values.

Source

pub fn set_positive_suffix(&mut self, suffix: NSString)

Sets the string the receiver uses as the suffix for positive values.

Source

pub fn negative_prefix(&self) -> NSString

The string the receiver uses as a prefix for negative values.

Source

pub fn set_negative_prefix(&mut self, prefix: NSString)

Sets the string the receiver uses as a prefix for negative values.

Source

pub fn negative_suffix(&self) -> NSString

The string the receiver uses as a suffix for negative values.

Source

pub fn text_attributes_for_negative_values(&self) -> NSDictionary<NSString, id>

The text attributes to be used in displaying negative values.

Source

pub fn set_text_attributes_for_negative_values( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes to be used in displaying negative values.

Source

pub fn text_attributes_for_positive_values(&self) -> NSDictionary<NSString, id>

The text attributes to be used in displaying positive values.

Source

pub fn set_text_attributes_for_positive_values( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes to be used in displaying positive values.

Source

pub fn attributed_string_for_zero(&self) -> NSAttributedString

The attributed string that the receiver uses to display zero values.

Source

pub fn set_attributed_string_for_zero(&mut self, string: NSAttributedString)

Sets the attributed string that the receiver uses to display zero values.

Source

pub fn text_attributes_for_zero(&self) -> NSDictionary<NSString, id>

The text attributes used to display a zero value.

Source

pub fn set_text_attributes_for_zero( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display a zero value.

Source

pub fn attributed_string_for_nil(&self) -> NSAttributedString

The attributed string the receiver uses to display nil values.

Source

pub fn set_attributed_string_for_nil(&mut self, string: NSAttributedString)

Sets the attributed string the receiver uses to display nil values.

Source

pub fn text_attributes_for_nil(&self) -> NSDictionary<NSString, id>

The text attributes used to display the nil symbol.

Source

pub fn set_text_attributes_for_nil( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display the nil symbol.

Source

pub fn attributed_string_for_not_a_number(&self) -> NSAttributedString

The attributed string the receiver uses to display “not a number” values.

Source

pub fn set_attributed_string_for_not_a_number( &mut self, string: NSAttributedString, )

Sets the attributed string the receiver uses to display “not a number” values.

Source

pub fn text_attributes_for_not_a_number(&self) -> NSDictionary<NSString, id>

The text attributes used to display the NaN (“not a number”) string.

Source

pub fn set_text_attributes_for_not_a_number( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display the NaN (“not a number”) string.

Source

pub fn text_attributes_for_positive_infinity( &self, ) -> NSDictionary<NSString, id>

The text attributes used to display the positive infinity symbol.

Source

pub fn set_text_attributes_for_positive_infinity( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display the positive infinity symbol.

Source

pub fn text_attributes_for_negative_infinity( &self, ) -> NSDictionary<NSString, id>

The text attributes used to display the negative infinity symbol.

Source

pub fn set_text_attributes_for_negative_infinity( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display the negative infinity symbol.

Source

pub fn grouping_separator(&self) -> NSString

The string used by the receiver for a grouping separator.

Source

pub fn set_grouping_separator(&mut self, separator: NSString)

Sets the string used by the receiver for a grouping separator.

Source

pub fn uses_grouping_separator(&self) -> bool

Determines whether the receiver displays the group separator.

Source

pub fn set_uses_grouping_separator(&mut self, flag: bool)

Sets whether the receiver displays the group separator.

Source

pub fn thousand_separator(&self) -> NSString

The character the receiver uses as a thousand separator.

Source

pub fn set_thousand_separator(&mut self, separator: NSString)

Sets the character the receiver uses as a thousand separator.

Source

pub fn uses_thousand_separators(&self) -> bool

Determines whether the receiver uses thousand separators.

Source

pub fn set_uses_thousand_separators(&mut self, flag: bool)

Sets whether the receiver uses thousand separators.

Source

pub fn decimal_separator(&self) -> NSString

The character the receiver uses as a decimal separator.

Source

pub fn always_show_decimal_separator(&self) -> bool

Determines whether the receiver always shows the decimal separator, even for integer numbers.

Source

pub fn set_always_show_decimal_separator(&mut self, flag: bool)

Sets whether the receiver always shows the decimal separator, even for integer numbers.

Source

pub fn currency_decimal_separator(&self) -> NSString

The string used by the receiver as a currency decimal separator.

Source

pub fn set_currency_decimal_separator(&mut self, separator: NSString)

Sets the string used by the receiver as a currency decimal separator.

Source

pub fn grouping_size(&self) -> Int

The grouping size of the receiver.

Source

pub fn set_grouping_size(&mut self, size: Int)

Sets the grouping size of the receiver.

Source

pub fn secondary_grouping_size(&self) -> Int

The secondary grouping size of the receiver.

Source

pub fn set_secondary_grouping_size(&mut self, size: Int)

Sets the secondary grouping size of the receiver.

Source

pub fn padding_character(&self) -> NSString

The string that the receiver uses to pad numbers in the formatted string representation.

Source

pub fn set_padding_character(&mut self, padding: NSString)

Sets the string that the receiver uses to pad numbers in the formatted string representation.

Source

pub fn padding_position(&self) -> NSNumberFormatterPadPosition

The padding position used by the receiver.

Source

pub fn set_padding_position(&mut self, position: NSNumberFormatterPadPosition)

Sets the padding position used by the receiver.

Source

pub fn allows_floats(&self) -> bool

Determines whether the receiver allows as input floating-point values (that is, values that include the period character [.]).

Source

pub fn set_allows_floats(&mut self, flag: bool)

Sets whether the receiver allows as input floating-point values (that is, values that include the period character [.]).

Source

pub fn minimum(&self) -> NSNumber

The lowest number allowed as input by the receiver.

Source

pub fn set_minimum(&mut self, number: NSNumber)

Sets the lowest number allowed as input by the receiver.

Source

pub fn maximum(&self) -> NSNumber

The highest number allowed as input by the receiver.

Source

pub fn set_maximum(&mut self, number: NSNumber)

Sets the highest number allowed as input by the receiver.

Source

pub fn lenient(&self) -> bool

Determines whether the receiver will use heuristics to guess at the number which is intended by a string.

Source

pub fn set_lenient(&mut self, flag: bool)

Sets whether the receiver will use heuristics to guess at the number which is intended by a string.

Source

pub fn partial_string_validation_enabled(&self) -> bool

Determines whether partial string validation is enabled for the receiver.

Source

pub fn set_partial_string_validation_enabled(&mut self, flag: bool)

Sets whether partial string validation is enabled for the receiver.

Methods from Deref<Target = Object>§

Source

pub fn class(&self) -> &Class

Returns the class of self.

Source

pub unsafe fn get_ivar<T>(&self, name: &str) -> &T
where T: Encode,

Returns a reference to the ivar of self with the given name. Panics if self has no ivar with the given name. Unsafe because the caller must ensure that the ivar is actually of type T.

Source

pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T
where T: Encode,

Returns a mutable reference to the ivar of self with the given name. Panics if self has no ivar with the given name. Unsafe because the caller must ensure that the ivar is actually of type T.

Source

pub unsafe fn set_ivar<T>(&mut self, name: &str, value: T)
where T: Encode,

Sets the value of the ivar of self with the given name. Panics if self has no ivar with the given name. Unsafe because the caller must ensure that the ivar is actually of type T.

Trait Implementations§

Source§

impl Clone for NSNumberFormatter

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NSNumberFormatter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for NSNumberFormatter

Source§

type Target = Object

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for NSNumberFormatter

Source§

fn deref_mut(&mut self) -> &mut Object

Mutably dereferences the value.
Source§

impl Display for NSNumberFormatter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Encode for NSNumberFormatter

Source§

fn encode() -> Encoding

Returns the Objective-C type encoding for Self.
Source§

impl FromId for NSNumberFormatter

Source§

unsafe fn from_id(ptr: id) -> Self

Returns Self representation of the object. Read more
Source§

impl Hash for NSNumberFormatter

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl INSFormatter for NSNumberFormatter

Source§

fn m_string_for_object_value(&self, obj: id) -> NSString

The default implementation of this method raises an exception. Read more
Source§

fn m_attributed_string_for_object_value_with_default_attributes( &self, obj: id, attrs: NSDictionary<NSAttributedStringKey, id>, ) -> NSAttributedString

The default implementation returns nil to indicate that the formatter object does not provide an attributed string. Read more
Source§

fn m_editing_string_for_object_value(&self, obj: id) -> NSString

The default implementation of this method invokes string_for_object_value. Read more
Source§

fn m_get_object_value_for_string_error_description( &self, obj: &mut id, string: NSString, error: &mut NSString, ) -> bool

The default implementation of this method raises an exception. Read more
Source§

fn m_is_partial_string_valid_new_editing_string_error_description( &self, partial_string: NSString, new_string: &mut NSString, error: &mut NSString, ) -> bool

Returns a Boolean value that indicates whether a partial string is valid. Read more
Source§

fn m_is_partial_string_valid_proposed_selected_range_original_string_original_selected_range_error_description( &self, partial_string_ptr: NSString, proposed_sel_range_ptr: NSRangePointer, orig_string: NSString, orig_sel_range: NSRange, error: &mut NSString, ) -> bool

This method should be implemented in subclasses that want to validate user changes to a string in a field, where the user changes are not necessarily at the end of the string, and preserve the selection (or set a different one, such as selecting the erroneous part of the string the user has typed).
Source§

impl INSNumberFormatter for NSNumberFormatter

Source§

fn p_formatter_behavior(&self) -> NSNumberFormatterBehavior

The formatter behavior of the receiver.
Source§

fn p_set_formatter_behavior(&mut self, behavior: NSNumberFormatterBehavior)

The formatter behavior of the receiver.
Source§

fn m_set_default_formatter_behavior(behavior: NSNumberFormatterBehavior)

Sets the default formatter behavior for new instances of NSNumberFormatter.
Source§

fn m_default_formatter_behavior() -> NSNumberFormatterBehavior

Returns an NSNumberFormatterBehavior constant that indicates default formatter behavior for new instances of NSNumberFormatter.
Source§

fn p_number_style(&self) -> NSNumberFormatterStyle

The number style used by the receiver.
Source§

fn p_set_number_style(&mut self, style: NSNumberFormatterStyle)

The number style used by the receiver.
Source§

fn p_generates_decimal_numbers(&self)

Determines whether the receiver creates instances of super::NSDecimalNumber when it converts strings to number objects.
Source§

fn m_get_object_value_for_string_range_error( &self, obj: id, string: NSString, rangep: NSRange, error: NSError, ) -> bool

Returns by reference a cell-content object after creating it from a range of characters in a given string.
Source§

fn m_number_from_string(&self, string: NSString) -> NSNumber

Returns an NSNumber object created by parsing a given string.
Source§

fn m_string_from_number(&self, number: NSNumber) -> NSString

Returns a string containing the formatted value of the provided number object.
Source§

fn m_localized_string_from_number_number_style( num: NSNumber, nstyle: NSNumberFormatterStyle, ) -> NSString

Returns a localized number string with the specified style.
Source§

fn p_localizes_format(&self) -> bool

Determines whether the dollar sign character ($), decimal separator character (.), and thousand separator character (,) are converted to appropriately localized characters as specified by the user’s localization preference.
Source§

fn p_set_localizes_format(&mut self, localizes_format: bool)

Sets whether the dollar sign character ($), decimal separator character (.), and thousand separator character (,) are converted to appropriately localized characters as specified by the user’s localization preference.
Source§

fn p_locale(&self) -> NSLocale

The locale of the receiver.
Source§

fn p_set_locale(&mut self, locale: NSLocale)

Sets the locale of the receiver.
Source§

fn p_rounding_behavior(&self) -> NSDecimalNumberHandler

The rounding behavior used by the receiver.
Source§

fn p_set_rounding_behavior(&mut self, behavior: NSNumberFormatterBehavior)

Set the rounding behavior used by the receiver.
Source§

fn p_rounding_increment(&self) -> NSNumber

The rounding increment used by the receiver.
Source§

fn p_set_rounding_increment(&mut self, number: NSNumber)

The rounding increment used by the receiver.
Source§

fn p_rounding_mode(&self) -> NSNumberFormatterRoundingMode

The rounding mode used by the receiver.
Source§

fn p_set_rounding_mode(&mut self, mode: NSNumberFormatterRoundingMode)

The rounding mode used by the receiver.
Source§

fn p_minimum_integer_digits(&self) -> UInt

The minimum number of digits before the decimal separator.
Source§

fn p_set_minimum_integer_digits(&mut self, min: UInt)

Sets the minimum number of digits before the decimal separator. Read more
Source§

fn p_maximum_integer_digits(&self) -> UInt

The maximum number of digits before the decimal separator.
Source§

fn p_set_maximum_integer_digits(&mut self, max: UInt)

The maximum number of digits before the decimal separator. Read more
Source§

fn p_minimum_fraction_digits(&self) -> UInt

The minimum number of digits after the decimal separator.
Source§

fn p_set_minimum_fraction_digits(&mut self, min: UInt)

Sets the minimum number of digits after the decimal separator. Read more
Source§

fn p_maximum_fraction_digits(&self) -> UInt

The maximum number of digits after the decimal separator.
Source§

fn p_set_maximum_fraction_digits(&mut self, max: UInt)

Sets the maximum number of digits after the decimal separator. Read more
Source§

fn p_uses_significant_digits(&self) -> bool

A Boolean value indicating whether the formatter uses minimum and maximum significant digits when formatting numbers.
Source§

fn p_set_uses_significant_digits(&mut self, uses: bool)

A Boolean value indicating whether the formatter uses minimum and maximum significant digits when formatting numbers. Read more
Source§

fn p_minimum_significant_digits(&self) -> UInt

The minimum number of significant digits for the number formatter.
Source§

fn p_set_minimum_significant_digits(&self, min: UInt)

Sets the minimum number of significant digits for the number formatter.
Source§

fn p_maximum_significant_digits(&self) -> UInt

The maximum number of significant digits for the number formatter.
Source§

fn p_set_maximum_significant_digits(&self, max: UInt)

Sets the maximum number of significant digits for the number formatter.
Source§

fn p_format(&self) -> NSString

The receiver’s format.
Source§

fn p_set_format(&mut self, format: NSString)

Sets the receiver’s format.
Source§

fn p_formatting_context(&self) -> NSFormattingContext

The capitalization formatting context used when formatting a number.
Source§

fn p_set_formatting_context(&mut self, context: NSFormattingContext)

Sets the capitalization formatting context used when formatting a number.
Source§

fn p_format_width(&self) -> UInt

The format width used by the receiver.
Source§

fn p_set_format_width(&mut self, width: UInt)

Sets the format width used by the receiver.
Source§

fn p_negative_format(&self) -> NSString

The format the receiver uses to display negative values.
Source§

fn p_set_negative_format(&mut self)

Sets the format the receiver uses to display negative values.
Source§

fn p_positive_format(&self) -> NSString

The format the receiver uses to display positive values.
Source§

fn p_set_positive_format(&mut self, format: NSString)

Sets the format the receiver uses to display positive values.
Source§

fn p_multiplier(&self) -> NSNumber

The multiplier of the receiver.
Source§

fn p_set_multiplier(&mut self, multiplier: NSNumber)

Sets the multiplier of the receiver.
Source§

fn p_percent_symbol(&self) -> NSString

The string used to represent a percent symbol.
Source§

fn p_set_percent_symbol(&mut self, symbol: NSString)

Sets the string used to represent a percent symbol.
Source§

fn p_per_mill_symbol(&self) -> NSString

The string used to represent a per-mill (per-thousand) symbol.
Source§

fn p_set_per_mill_symbol(&mut self, symbol: NSString)

The string used to represent a per-mill (per-thousand) symbol.
Source§

fn p_minus_sign(&self) -> NSString

The string used to represent a minus sign.
Source§

fn p_set_minus_sign(&mut self, sign: NSString)

Sets the string used to represent a minus sign.
Source§

fn p_plus_sign(&self) -> NSString

The string used to represent a plus sign.
Source§

fn p_set_plus_sign(&mut self, sign: NSString)

Sets the string used to represent a plus sign.
Source§

fn p_exponent_symbol(&self) -> NSString

The string used to represent an exponent symbol.
Source§

fn p_set_exponent_symbol(&mut self, sign: NSString)

Sets the string used to represent an exponent symbol.
Source§

fn p_zero_symbol(&self) -> NSString

The string used to represent a zero symbol.
Source§

fn p_set_zero_symbol(&mut self, sign: NSString)

Sets the string used to represent a zero symbol.
Source§

fn p_nil_symbol(&self) -> NSString

The string used to represent a nil symbol.
Source§

fn p_set_nil_symbol(&mut self, sign: NSString)

Sets the string used to represent a nil symbol.
Source§

fn p_not_a_number_symbol(&self) -> NSString

The string used to represent a NaN (“not a number”) value.
Source§

fn p_set_not_a_number_symbol(&mut self, symbol: NSString)

Sets the string used to represent a NaN (“not a number”) value.
Source§

fn p_negative_infinity_symbol(&self) -> NSString

The string used to represent a negative infinity symbol.
Source§

fn p_set_negative_infinity_symbol(&self, symbol: NSString)

Sets the string used to represent a negative infinity symbol.
Source§

fn p_positive_infinity_symbol(&self) -> NSString

The string used to represent a positive infinity symbol.
Source§

fn p_set_positive_infinity_symbol(&self, symbol: NSString)

Sets the string used to represent a positive infinity symbol.
Source§

fn p_currency_symbol(&self) -> NSString

The string used by the receiver as a local currency symbol.
Source§

fn p_set_currency_symbol(&mut self, symbol: NSString)

Sets the string used by the receiver as a local currency symbol.
Source§

fn p_currency_code(&self) -> NSString

The receiver’s currency code.
Source§

fn p_set_currency_code(&mut self, code: NSString)

Sets the receiver’s currency code.
Source§

fn p_international_currency_symbol(&self) -> NSString

The international currency symbol used by the receiver.
Source§

fn p_set_international_currency_symbol(&mut self, symbol: NSString)

Sets the international currency symbol used by the receiver.
Source§

fn p_currency_grouping_separator(&self) -> NSString

The currency grouping separator for the receiver.
Source§

fn p_positive_prefix(&self) -> NSString

The string the receiver uses as the prefix for positive values.
Source§

fn p_set_positive_prefix(&mut self, prefix: NSString)

Sets the string the receiver uses as the prefix for positive values.
Source§

fn p_positive_suffix(&self) -> NSString

The string the receiver uses as the suffix for positive values.
Source§

fn p_set_positive_suffix(&mut self, suffix: NSString)

Sets the string the receiver uses as the suffix for positive values.
Source§

fn p_negative_prefix(&self) -> NSString

The string the receiver uses as a prefix for negative values.
Source§

fn p_set_negative_prefix(&mut self, prefix: NSString)

Sets the string the receiver uses as a prefix for negative values.
Source§

fn p_negative_suffix(&self) -> NSString

The string the receiver uses as a suffix for negative values.
Source§

fn p_text_attributes_for_negative_values(&self) -> NSDictionary<NSString, id>

The text attributes to be used in displaying negative values.
Source§

fn p_set_text_attributes_for_negative_values( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes to be used in displaying negative values.
Source§

fn p_text_attributes_for_positive_values(&self) -> NSDictionary<NSString, id>

The text attributes to be used in displaying positive values.
Source§

fn p_set_text_attributes_for_positive_values( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes to be used in displaying positive values.
Source§

fn p_attributed_string_for_zero(&self) -> NSAttributedString

The attributed string that the receiver uses to display zero values.
Source§

fn p_set_attributed_string_for_zero(&mut self, string: NSAttributedString)

Sets the attributed string that the receiver uses to display zero values.
Source§

fn p_text_attributes_for_zero(&self) -> NSDictionary<NSString, id>

The text attributes used to display a zero value.
Source§

fn p_set_text_attributes_for_zero( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display a zero value.
Source§

fn p_attributed_string_for_nil(&self) -> NSAttributedString

The attributed string the receiver uses to display nil values.
Source§

fn p_set_attributed_string_for_nil(&mut self, string: NSAttributedString)

Sets the attributed string the receiver uses to display nil values.
Source§

fn p_text_attributes_for_nil(&self) -> NSDictionary<NSString, id>

The text attributes used to display the nil symbol.
Source§

fn p_set_text_attributes_for_nil( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display the nil symbol.
Source§

fn p_attributed_string_for_not_a_number(&self) -> NSAttributedString

The attributed string the receiver uses to display “not a number” values.
Source§

fn p_set_attributed_string_for_not_a_number( &mut self, string: NSAttributedString, )

Sets the attributed string the receiver uses to display “not a number” values.
Source§

fn p_text_attributes_for_not_a_number(&self) -> NSDictionary<NSString, id>

The text attributes used to display the NaN (“not a number”) string.
Source§

fn p_set_text_attributes_for_not_a_number( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display the NaN (“not a number”) string.
Source§

fn p_text_attributes_for_positive_infinity(&self) -> NSDictionary<NSString, id>

The text attributes used to display the positive infinity symbol.
Source§

fn p_set_text_attributes_for_positive_infinity( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display the positive infinity symbol.
Source§

fn p_text_attributes_for_negative_infinity(&self) -> NSDictionary<NSString, id>

The text attributes used to display the negative infinity symbol.
Source§

fn p_set_text_attributes_for_negative_infinity( &mut self, attributes: NSDictionary<NSString, id>, )

Sets the text attributes used to display the negative infinity symbol.
Source§

fn p_grouping_separator(&self) -> NSString

The string used by the receiver for a grouping separator.
Source§

fn p_set_grouping_separator(&mut self, separator: NSString)

Sets the string used by the receiver for a grouping separator.
Source§

fn p_uses_grouping_separator(&self) -> bool

Determines whether the receiver displays the group separator.
Source§

fn p_set_uses_grouping_separator(&mut self, flag: bool)

Sets whether the receiver displays the group separator.
Source§

fn p_thousand_separator(&self) -> NSString

The character the receiver uses as a thousand separator.
Source§

fn p_set_thousand_separator(&mut self, separator: NSString)

Sets the character the receiver uses as a thousand separator.
Source§

fn p_uses_thousand_separators(&self) -> bool

Determines whether the receiver uses thousand separators.
Source§

fn p_set_uses_thousand_separators(&mut self, flag: bool)

Sets whether the receiver uses thousand separators.
Source§

fn p_decimal_separator(&self) -> NSString

The character the receiver uses as a decimal separator.
Source§

fn p_always_show_decimal_separator(&self) -> bool

Determines whether the receiver always shows the decimal separator, even for integer numbers.
Source§

fn p_set_always_show_decimal_separator(&mut self, flag: bool)

Sets whether the receiver always shows the decimal separator, even for integer numbers.
Source§

fn p_currency_decimal_separator(&self) -> NSString

The string used by the receiver as a currency decimal separator.
Source§

fn p_set_currency_decimal_separator(&mut self, separator: NSString)

Sets the string used by the receiver as a currency decimal separator.
Source§

fn p_grouping_size(&self) -> Int

The grouping size of the receiver.
Source§

fn p_set_grouping_size(&mut self, size: Int)

Sets the grouping size of the receiver.
Source§

fn p_secondary_grouping_size(&self) -> Int

The secondary grouping size of the receiver.
Source§

fn p_set_secondary_grouping_size(&mut self, size: Int)

Sets the secondary grouping size of the receiver.
Source§

fn p_padding_character(&self) -> NSString

The string that the receiver uses to pad numbers in the formatted string representation.
Source§

fn p_set_padding_character(&mut self, padding: NSString)

Sets the string that the receiver uses to pad numbers in the formatted string representation.
Source§

fn p_padding_position(&self) -> NSNumberFormatterPadPosition

The padding position used by the receiver.
Source§

fn p_set_padding_position(&mut self, position: NSNumberFormatterPadPosition)

Sets the padding position used by the receiver.
Source§

fn p_allows_floats(&self) -> bool

Determines whether the receiver allows as input floating-point values (that is, values that include the period character [.]).
Source§

fn p_set_allows_floats(&mut self, flag: bool)

Sets whether the receiver allows as input floating-point values (that is, values that include the period character [.]).
Source§

fn p_minimum(&self) -> NSNumber

The lowest number allowed as input by the receiver.
Source§

fn p_set_minimum(&mut self, number: NSNumber)

Sets the lowest number allowed as input by the receiver.
Source§

fn p_maximum(&self) -> NSNumber

The highest number allowed as input by the receiver.
Source§

fn p_set_maximum(&mut self, number: NSNumber)

Sets the highest number allowed as input by the receiver.
Source§

fn p_lenient(&self) -> bool

Determines whether the receiver will use heuristics to guess at the number which is intended by a string.
Source§

fn p_set_lenient(&mut self, flag: bool)

Sets whether the receiver will use heuristics to guess at the number which is intended by a string.
Source§

fn p_partial_string_validation_enabled(&self) -> bool

Determines whether partial string validation is enabled for the receiver.
Source§

fn p_set_partial_string_validation_enabled(&mut self, flag: bool)

Sets whether partial string validation is enabled for the receiver.
Source§

impl PNSObject for NSNumberFormatter

Source§

fn m_class<'a>() -> &'a Class

Returns the class object for the receiver’s class.
Source§

fn m_self(&self) -> id

Returns the receiver.
Source§

fn m_new() -> Self
where Self: Sized + FromId,

Allocates a new instance of the receiving class, sends it an init message, and returns the initialized object.
Source§

fn m_alloc() -> Self
where Self: Sized + FromId,

Returns a new instance of the receiving class.
Source§

fn m_initialize()

Initializes the class before it receives its first message.
Source§

fn ip_superclass<'a>() -> Option<&'a Class>

Returns the class object for the receiver’s superclass.
Source§

fn m_is_equal(&self, object: &Self) -> bool

Returns a Boolean value that indicates whether the receiver and a given object are equal.
Source§

fn p_hash(&self) -> UInt

Returns an integer that can be used as a table address in a hash table structure.
Source§

fn m_is_kind_of_class(&self, class: Class) -> bool

Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class.
Source§

fn m_is_member_of_class(&self, class: Class) -> bool

Returns a Boolean value that indicates whether the receiver is an instance of a given class.
Source§

fn m_responds_to_selector(&self, selector: Sel) -> bool

Returns a Boolean value that indicates whether the receiver implements or inherits a method that can respond to a specified message.
Source§

fn m_conforms_to_protocol(&self, protocol: Protocol) -> bool

Returns a Boolean value that indicates whether the receiver conforms to a given protocol.
Source§

fn p_description(&self) -> NSString

A textual representation of the receiver.
Source§

fn p_debug_description(&self) -> NSString

A textual representation of the receiver to use with a debugger.
Source§

fn m_perform_selector(&self, selector: Sel) -> id

Sends a specified message to the receiver and returns the result of the message.
Source§

fn m_perform_selector_with_object(&self, selector: Sel, with_object: id) -> id

Sends a message to the receiver with an object as the argument.
Source§

fn m_is_proxy(&self) -> bool

Returns a Boolean value that indicates whether the receiver does not descend from NSObject.
Source§

impl ToId for NSNumberFormatter

Source§

fn to_id(self) -> id

Returns id representation of the object.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.