#[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
impl NSNumberFormatter
Sourcepub fn formatter_behavior(&self) -> NSNumberFormatterBehavior
pub fn formatter_behavior(&self) -> NSNumberFormatterBehavior
The formatter behavior of the receiver.
Sourcepub fn set_formatter_behavior(&mut self, behavior: NSNumberFormatterBehavior)
pub fn set_formatter_behavior(&mut self, behavior: NSNumberFormatterBehavior)
The formatter behavior of the receiver.
Sourcepub fn set_default_formatter_behavior(behavior: NSNumberFormatterBehavior)
pub fn set_default_formatter_behavior(behavior: NSNumberFormatterBehavior)
Sets the default formatter behavior for new instances of
NSNumberFormatter
.
Sourcepub fn default_formatter_behavior() -> NSNumberFormatterBehavior
pub fn default_formatter_behavior() -> NSNumberFormatterBehavior
Returns an NSNumberFormatterBehavior
constant that indicates default
formatter behavior for new instances of NSNumberFormatter.
Sourcepub fn number_style(&self) -> NSNumberFormatterStyle
pub fn number_style(&self) -> NSNumberFormatterStyle
The number style used by the receiver.
Sourcepub fn set_number_style(&mut self, style: NSNumberFormatterStyle)
pub fn set_number_style(&mut self, style: NSNumberFormatterStyle)
The number style used by the receiver.
Sourcepub fn generates_decimal_numbers(&self)
pub fn generates_decimal_numbers(&self)
Determines whether the receiver creates instances of super::NSDecimalNumber
when it converts strings to number objects.
Sourcepub fn get_object_value_for_string_range_error(
&self,
obj: id,
string: NSString,
rangep: NSRange,
error: NSError,
) -> bool
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.
Sourcepub fn number_from_string(&self, string: NSString) -> NSNumber
pub fn number_from_string(&self, string: NSString) -> NSNumber
Returns an NSNumber
object created by parsing a given string.
Sourcepub fn string_from_number(&self, number: NSNumber) -> NSString
pub fn string_from_number(&self, number: NSNumber) -> NSString
Returns a string containing the formatted value of the provided number object.
Sourcepub fn localized_string_from_number_number_style(
num: NSNumber,
nstyle: NSNumberFormatterStyle,
) -> NSString
pub fn localized_string_from_number_number_style( num: NSNumber, nstyle: NSNumberFormatterStyle, ) -> NSString
Returns a localized number string with the specified style.
Sourcepub fn localizes_format(&self) -> bool
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.
Sourcepub fn set_localizes_format(&mut self, localizes_format: bool)
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.
Sourcepub fn set_locale(&mut self, locale: NSLocale)
pub fn set_locale(&mut self, locale: NSLocale)
Sets the locale of the receiver.
Sourcepub fn rounding_behavior(&self) -> NSDecimalNumberHandler
pub fn rounding_behavior(&self) -> NSDecimalNumberHandler
The rounding behavior used by the receiver.
Sourcepub fn set_rounding_behavior(&mut self, behavior: NSNumberFormatterBehavior)
pub fn set_rounding_behavior(&mut self, behavior: NSNumberFormatterBehavior)
Set the rounding behavior used by the receiver.
Sourcepub fn rounding_increment(&self) -> NSNumber
pub fn rounding_increment(&self) -> NSNumber
The rounding increment used by the receiver.
Sourcepub fn set_rounding_increment(&mut self, number: NSNumber)
pub fn set_rounding_increment(&mut self, number: NSNumber)
The rounding increment used by the receiver.
Sourcepub fn rounding_mode(&self) -> NSNumberFormatterRoundingMode
pub fn rounding_mode(&self) -> NSNumberFormatterRoundingMode
The rounding mode used by the receiver.
Sourcepub fn set_rounding_mode(&mut self, mode: NSNumberFormatterRoundingMode)
pub fn set_rounding_mode(&mut self, mode: NSNumberFormatterRoundingMode)
The rounding mode used by the receiver.
Sourcepub fn minimum_integer_digits(&self) -> UInt
pub fn minimum_integer_digits(&self) -> UInt
The minimum number of digits before the decimal separator.
Sourcepub fn set_minimum_integer_digits(&mut self, min: UInt)
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");
Sourcepub fn maximum_integer_digits(&self) -> UInt
pub fn maximum_integer_digits(&self) -> UInt
The maximum number of digits before the decimal separator.
Sourcepub fn set_maximum_integer_digits(&mut self, max: UInt)
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");
Sourcepub fn minimum_fraction_digits(&self) -> UInt
pub fn minimum_fraction_digits(&self) -> UInt
The minimum number of digits after the decimal separator.
Sourcepub fn set_minimum_fraction_digits(&mut self, min: UInt)
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");
Sourcepub fn maximum_fraction_digits(&self) -> UInt
pub fn maximum_fraction_digits(&self) -> UInt
The maximum number of digits after the decimal separator.
Sourcepub fn set_maximum_fraction_digits(&mut self, max: UInt)
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");
Sourcepub fn uses_significant_digits(&self) -> bool
pub fn uses_significant_digits(&self) -> bool
A Boolean value indicating whether the formatter uses minimum and maximum significant digits when formatting numbers.
Sourcepub fn set_uses_significant_digits(&mut self, uses: bool)
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");
Sourcepub fn minimum_significant_digits(&self) -> UInt
pub fn minimum_significant_digits(&self) -> UInt
The minimum number of significant digits for the number formatter.
Sourcepub fn set_minimum_significant_digits(&self, min: UInt)
pub fn set_minimum_significant_digits(&self, min: UInt)
Sets the minimum number of significant digits for the number formatter.
Sourcepub fn maximum_significant_digits(&self) -> UInt
pub fn maximum_significant_digits(&self) -> UInt
The maximum number of significant digits for the number formatter.
Sourcepub fn set_maximum_significant_digits(&self, max: UInt)
pub fn set_maximum_significant_digits(&self, max: UInt)
Sets the maximum number of significant digits for the number formatter.
Sourcepub fn set_format(&mut self, format: NSString)
pub fn set_format(&mut self, format: NSString)
Sets the receiver’s format.
Sourcepub fn formatting_context(&self) -> NSFormattingContext
pub fn formatting_context(&self) -> NSFormattingContext
The capitalization formatting context used when formatting a number.
Sourcepub fn set_formatting_context(&mut self, context: NSFormattingContext)
pub fn set_formatting_context(&mut self, context: NSFormattingContext)
Sets the capitalization formatting context used when formatting a number.
Sourcepub fn format_width(&self) -> UInt
pub fn format_width(&self) -> UInt
The format width used by the receiver.
Sourcepub fn set_format_width(&mut self, width: UInt)
pub fn set_format_width(&mut self, width: UInt)
Sets the format width used by the receiver.
Sourcepub fn negative_format(&self) -> NSString
pub fn negative_format(&self) -> NSString
The format the receiver uses to display negative values.
Sourcepub fn set_negative_format(&mut self)
pub fn set_negative_format(&mut self)
Sets the format the receiver uses to display negative values.
Sourcepub fn positive_format(&self) -> NSString
pub fn positive_format(&self) -> NSString
The format the receiver uses to display positive values.
Sourcepub fn set_positive_format(&mut self, format: NSString)
pub fn set_positive_format(&mut self, format: NSString)
Sets the format the receiver uses to display positive values.
Sourcepub fn multiplier(&self) -> NSNumber
pub fn multiplier(&self) -> NSNumber
The multiplier of the receiver.
Sourcepub fn set_multiplier(&mut self, multiplier: NSNumber)
pub fn set_multiplier(&mut self, multiplier: NSNumber)
Sets the multiplier of the receiver.
Sourcepub fn percent_symbol(&self) -> NSString
pub fn percent_symbol(&self) -> NSString
The string used to represent a percent symbol.
Sourcepub fn set_percent_symbol(&mut self, symbol: NSString)
pub fn set_percent_symbol(&mut self, symbol: NSString)
Sets the string used to represent a percent symbol.
Sourcepub fn per_mill_symbol(&self) -> NSString
pub fn per_mill_symbol(&self) -> NSString
The string used to represent a per-mill (per-thousand) symbol.
Sourcepub fn set_per_mill_symbol(&mut self, symbol: NSString)
pub fn set_per_mill_symbol(&mut self, symbol: NSString)
The string used to represent a per-mill (per-thousand) symbol.
Sourcepub fn minus_sign(&self) -> NSString
pub fn minus_sign(&self) -> NSString
The string used to represent a minus sign.
Sourcepub fn set_minus_sign(&mut self, sign: NSString)
pub fn set_minus_sign(&mut self, sign: NSString)
Sets the string used to represent a minus sign.
Sourcepub fn set_plus_sign(&mut self, sign: NSString)
pub fn set_plus_sign(&mut self, sign: NSString)
Sets the string used to represent a plus sign.
Sourcepub fn exponent_symbol(&self) -> NSString
pub fn exponent_symbol(&self) -> NSString
The string used to represent an exponent symbol.
Sourcepub fn set_exponent_symbol(&mut self, sign: NSString)
pub fn set_exponent_symbol(&mut self, sign: NSString)
Sets the string used to represent an exponent symbol.
Sourcepub fn zero_symbol(&self) -> NSString
pub fn zero_symbol(&self) -> NSString
The string used to represent a zero symbol.
Sourcepub fn set_zero_symbol(&mut self, sign: NSString)
pub fn set_zero_symbol(&mut self, sign: NSString)
Sets the string used to represent a zero symbol.
Sourcepub fn nil_symbol(&self) -> NSString
pub fn nil_symbol(&self) -> NSString
The string used to represent a nil symbol.
Sourcepub fn set_nil_symbol(&mut self, sign: NSString)
pub fn set_nil_symbol(&mut self, sign: NSString)
Sets the string used to represent a nil symbol.
Sourcepub fn not_a_number_symbol(&self) -> NSString
pub fn not_a_number_symbol(&self) -> NSString
The string used to represent a NaN (“not a number”) value.
Sourcepub fn set_not_a_number_symbol(&mut self, symbol: NSString)
pub fn set_not_a_number_symbol(&mut self, symbol: NSString)
Sets the string used to represent a NaN (“not a number”) value.
Sourcepub fn negative_infinity_symbol(&self) -> NSString
pub fn negative_infinity_symbol(&self) -> NSString
The string used to represent a negative infinity symbol.
Sourcepub fn set_negative_infinity_symbol(&self, symbol: NSString)
pub fn set_negative_infinity_symbol(&self, symbol: NSString)
Sets the string used to represent a negative infinity symbol.
Sourcepub fn positive_infinity_symbol(&self) -> NSString
pub fn positive_infinity_symbol(&self) -> NSString
The string used to represent a positive infinity symbol.
Sourcepub fn set_positive_infinity_symbol(&self, symbol: NSString)
pub fn set_positive_infinity_symbol(&self, symbol: NSString)
Sets the string used to represent a positive infinity symbol.
Sourcepub fn currency_symbol(&self) -> NSString
pub fn currency_symbol(&self) -> NSString
The string used by the receiver as a local currency symbol.
Sourcepub fn set_currency_symbol(&mut self, symbol: NSString)
pub fn set_currency_symbol(&mut self, symbol: NSString)
Sets the string used by the receiver as a local currency symbol.
Sourcepub fn currency_code(&self) -> NSString
pub fn currency_code(&self) -> NSString
The receiver’s currency code.
Sourcepub fn set_currency_code(&mut self, code: NSString)
pub fn set_currency_code(&mut self, code: NSString)
Sets the receiver’s currency code.
Sourcepub fn international_currency_symbol(&self) -> NSString
pub fn international_currency_symbol(&self) -> NSString
The international currency symbol used by the receiver.
Sourcepub fn set_international_currency_symbol(&mut self, symbol: NSString)
pub fn set_international_currency_symbol(&mut self, symbol: NSString)
Sets the international currency symbol used by the receiver.
Sourcepub fn currency_grouping_separator(&self) -> NSString
pub fn currency_grouping_separator(&self) -> NSString
The currency grouping separator for the receiver.
Sourcepub fn positive_prefix(&self) -> NSString
pub fn positive_prefix(&self) -> NSString
The string the receiver uses as the prefix for positive values.
Sourcepub fn set_positive_prefix(&mut self, prefix: NSString)
pub fn set_positive_prefix(&mut self, prefix: NSString)
Sets the string the receiver uses as the prefix for positive values.
Sourcepub fn positive_suffix(&self) -> NSString
pub fn positive_suffix(&self) -> NSString
The string the receiver uses as the suffix for positive values.
Sourcepub fn set_positive_suffix(&mut self, suffix: NSString)
pub fn set_positive_suffix(&mut self, suffix: NSString)
Sets the string the receiver uses as the suffix for positive values.
Sourcepub fn negative_prefix(&self) -> NSString
pub fn negative_prefix(&self) -> NSString
The string the receiver uses as a prefix for negative values.
Sourcepub fn set_negative_prefix(&mut self, prefix: NSString)
pub fn set_negative_prefix(&mut self, prefix: NSString)
Sets the string the receiver uses as a prefix for negative values.
Sourcepub fn negative_suffix(&self) -> NSString
pub fn negative_suffix(&self) -> NSString
The string the receiver uses as a suffix for negative values.
Sourcepub fn text_attributes_for_negative_values(&self) -> NSDictionary<NSString, id>
pub fn text_attributes_for_negative_values(&self) -> NSDictionary<NSString, id>
The text attributes to be used in displaying negative values.
Sourcepub fn set_text_attributes_for_negative_values(
&mut self,
attributes: NSDictionary<NSString, id>,
)
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.
Sourcepub fn text_attributes_for_positive_values(&self) -> NSDictionary<NSString, id>
pub fn text_attributes_for_positive_values(&self) -> NSDictionary<NSString, id>
The text attributes to be used in displaying positive values.
Sourcepub fn set_text_attributes_for_positive_values(
&mut self,
attributes: NSDictionary<NSString, id>,
)
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.
Sourcepub fn attributed_string_for_zero(&self) -> NSAttributedString
pub fn attributed_string_for_zero(&self) -> NSAttributedString
The attributed string that the receiver uses to display zero values.
Sourcepub fn set_attributed_string_for_zero(&mut self, string: NSAttributedString)
pub fn set_attributed_string_for_zero(&mut self, string: NSAttributedString)
Sets the attributed string that the receiver uses to display zero values.
Sourcepub fn text_attributes_for_zero(&self) -> NSDictionary<NSString, id>
pub fn text_attributes_for_zero(&self) -> NSDictionary<NSString, id>
The text attributes used to display a zero value.
Sourcepub fn set_text_attributes_for_zero(
&mut self,
attributes: NSDictionary<NSString, id>,
)
pub fn set_text_attributes_for_zero( &mut self, attributes: NSDictionary<NSString, id>, )
Sets the text attributes used to display a zero value.
Sourcepub fn attributed_string_for_nil(&self) -> NSAttributedString
pub fn attributed_string_for_nil(&self) -> NSAttributedString
The attributed string the receiver uses to display nil values.
Sourcepub fn set_attributed_string_for_nil(&mut self, string: NSAttributedString)
pub fn set_attributed_string_for_nil(&mut self, string: NSAttributedString)
Sets the attributed string the receiver uses to display nil values.
Sourcepub fn text_attributes_for_nil(&self) -> NSDictionary<NSString, id>
pub fn text_attributes_for_nil(&self) -> NSDictionary<NSString, id>
The text attributes used to display the nil symbol.
Sourcepub fn set_text_attributes_for_nil(
&mut self,
attributes: NSDictionary<NSString, id>,
)
pub fn set_text_attributes_for_nil( &mut self, attributes: NSDictionary<NSString, id>, )
Sets the text attributes used to display the nil symbol.
Sourcepub fn attributed_string_for_not_a_number(&self) -> NSAttributedString
pub fn attributed_string_for_not_a_number(&self) -> NSAttributedString
The attributed string the receiver uses to display “not a number” values.
Sourcepub fn set_attributed_string_for_not_a_number(
&mut self,
string: NSAttributedString,
)
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.
Sourcepub fn text_attributes_for_not_a_number(&self) -> NSDictionary<NSString, id>
pub fn text_attributes_for_not_a_number(&self) -> NSDictionary<NSString, id>
The text attributes used to display the NaN (“not a number”) string.
Sourcepub fn set_text_attributes_for_not_a_number(
&mut self,
attributes: NSDictionary<NSString, id>,
)
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.
Sourcepub fn text_attributes_for_positive_infinity(
&self,
) -> NSDictionary<NSString, id>
pub fn text_attributes_for_positive_infinity( &self, ) -> NSDictionary<NSString, id>
The text attributes used to display the positive infinity symbol.
Sourcepub fn set_text_attributes_for_positive_infinity(
&mut self,
attributes: NSDictionary<NSString, id>,
)
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.
Sourcepub fn text_attributes_for_negative_infinity(
&self,
) -> NSDictionary<NSString, id>
pub fn text_attributes_for_negative_infinity( &self, ) -> NSDictionary<NSString, id>
The text attributes used to display the negative infinity symbol.
Sourcepub fn set_text_attributes_for_negative_infinity(
&mut self,
attributes: NSDictionary<NSString, id>,
)
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.
Sourcepub fn grouping_separator(&self) -> NSString
pub fn grouping_separator(&self) -> NSString
The string used by the receiver for a grouping separator.
Sourcepub fn set_grouping_separator(&mut self, separator: NSString)
pub fn set_grouping_separator(&mut self, separator: NSString)
Sets the string used by the receiver for a grouping separator.
Sourcepub fn uses_grouping_separator(&self) -> bool
pub fn uses_grouping_separator(&self) -> bool
Determines whether the receiver displays the group separator.
Sourcepub fn set_uses_grouping_separator(&mut self, flag: bool)
pub fn set_uses_grouping_separator(&mut self, flag: bool)
Sets whether the receiver displays the group separator.
Sourcepub fn thousand_separator(&self) -> NSString
pub fn thousand_separator(&self) -> NSString
The character the receiver uses as a thousand separator.
Sourcepub fn set_thousand_separator(&mut self, separator: NSString)
pub fn set_thousand_separator(&mut self, separator: NSString)
Sets the character the receiver uses as a thousand separator.
Sourcepub fn uses_thousand_separators(&self) -> bool
pub fn uses_thousand_separators(&self) -> bool
Determines whether the receiver uses thousand separators.
Sourcepub fn set_uses_thousand_separators(&mut self, flag: bool)
pub fn set_uses_thousand_separators(&mut self, flag: bool)
Sets whether the receiver uses thousand separators.
Sourcepub fn decimal_separator(&self) -> NSString
pub fn decimal_separator(&self) -> NSString
The character the receiver uses as a decimal separator.
Sourcepub fn always_show_decimal_separator(&self) -> bool
pub fn always_show_decimal_separator(&self) -> bool
Determines whether the receiver always shows the decimal separator, even for integer numbers.
Sourcepub fn set_always_show_decimal_separator(&mut self, flag: bool)
pub fn set_always_show_decimal_separator(&mut self, flag: bool)
Sets whether the receiver always shows the decimal separator, even for integer numbers.
Sourcepub fn currency_decimal_separator(&self) -> NSString
pub fn currency_decimal_separator(&self) -> NSString
The string used by the receiver as a currency decimal separator.
Sourcepub fn set_currency_decimal_separator(&mut self, separator: NSString)
pub fn set_currency_decimal_separator(&mut self, separator: NSString)
Sets the string used by the receiver as a currency decimal separator.
Sourcepub fn grouping_size(&self) -> Int
pub fn grouping_size(&self) -> Int
The grouping size of the receiver.
Sourcepub fn set_grouping_size(&mut self, size: Int)
pub fn set_grouping_size(&mut self, size: Int)
Sets the grouping size of the receiver.
Sourcepub fn secondary_grouping_size(&self) -> Int
pub fn secondary_grouping_size(&self) -> Int
The secondary grouping size of the receiver.
Sourcepub fn set_secondary_grouping_size(&mut self, size: Int)
pub fn set_secondary_grouping_size(&mut self, size: Int)
Sets the secondary grouping size of the receiver.
Sourcepub fn padding_character(&self) -> NSString
pub fn padding_character(&self) -> NSString
The string that the receiver uses to pad numbers in the formatted string representation.
Sourcepub fn set_padding_character(&mut self, padding: NSString)
pub fn set_padding_character(&mut self, padding: NSString)
Sets the string that the receiver uses to pad numbers in the formatted string representation.
Sourcepub fn padding_position(&self) -> NSNumberFormatterPadPosition
pub fn padding_position(&self) -> NSNumberFormatterPadPosition
The padding position used by the receiver.
Sourcepub fn set_padding_position(&mut self, position: NSNumberFormatterPadPosition)
pub fn set_padding_position(&mut self, position: NSNumberFormatterPadPosition)
Sets the padding position used by the receiver.
Sourcepub fn allows_floats(&self) -> bool
pub fn allows_floats(&self) -> bool
Determines whether the receiver allows as input floating-point values (that is, values that include the period character [.]).
Sourcepub fn set_allows_floats(&mut self, flag: bool)
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 [.]).
Sourcepub fn set_minimum(&mut self, number: NSNumber)
pub fn set_minimum(&mut self, number: NSNumber)
Sets the lowest number allowed as input by the receiver.
Sourcepub fn set_maximum(&mut self, number: NSNumber)
pub fn set_maximum(&mut self, number: NSNumber)
Sets the highest number allowed as input by the receiver.
Sourcepub fn lenient(&self) -> bool
pub fn lenient(&self) -> bool
Determines whether the receiver will use heuristics to guess at the number which is intended by a string.
Sourcepub fn set_lenient(&mut self, flag: bool)
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.
Sourcepub fn partial_string_validation_enabled(&self) -> bool
pub fn partial_string_validation_enabled(&self) -> bool
Determines whether partial string validation is enabled for the receiver.
Sourcepub fn set_partial_string_validation_enabled(&mut self, flag: bool)
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>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
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
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
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
.
Trait Implementations§
Source§impl Clone for NSNumberFormatter
impl Clone for NSNumberFormatter
Source§impl Debug for NSNumberFormatter
impl Debug for NSNumberFormatter
Source§impl Deref for NSNumberFormatter
impl Deref for NSNumberFormatter
Source§impl DerefMut for NSNumberFormatter
impl DerefMut for NSNumberFormatter
Source§impl Display for NSNumberFormatter
impl Display for NSNumberFormatter
Source§impl Encode for NSNumberFormatter
impl Encode for NSNumberFormatter
Source§impl FromId for NSNumberFormatter
impl FromId for NSNumberFormatter
Source§impl Hash for NSNumberFormatter
impl Hash for NSNumberFormatter
Source§impl INSFormatter for NSNumberFormatter
impl INSFormatter for NSNumberFormatter
Source§fn m_string_for_object_value(&self, obj: id) -> NSString
fn m_string_for_object_value(&self, obj: id) -> NSString
Source§fn m_attributed_string_for_object_value_with_default_attributes(
&self,
obj: id,
attrs: NSDictionary<NSAttributedStringKey, id>,
) -> NSAttributedString
fn m_attributed_string_for_object_value_with_default_attributes( &self, obj: id, attrs: NSDictionary<NSAttributedStringKey, id>, ) -> NSAttributedString
Source§fn m_editing_string_for_object_value(&self, obj: id) -> NSString
fn m_editing_string_for_object_value(&self, obj: id) -> NSString
Source§fn m_get_object_value_for_string_error_description(
&self,
obj: &mut id,
string: NSString,
error: &mut NSString,
) -> bool
fn m_get_object_value_for_string_error_description( &self, obj: &mut id, string: NSString, error: &mut NSString, ) -> bool
Source§fn m_is_partial_string_valid_new_editing_string_error_description(
&self,
partial_string: NSString,
new_string: &mut NSString,
error: &mut NSString,
) -> bool
fn m_is_partial_string_valid_new_editing_string_error_description( &self, partial_string: NSString, new_string: &mut NSString, error: &mut NSString, ) -> bool
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
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
Source§impl INSNumberFormatter for NSNumberFormatter
impl INSNumberFormatter for NSNumberFormatter
Source§fn p_formatter_behavior(&self) -> NSNumberFormatterBehavior
fn p_formatter_behavior(&self) -> NSNumberFormatterBehavior
Source§fn p_set_formatter_behavior(&mut self, behavior: NSNumberFormatterBehavior)
fn p_set_formatter_behavior(&mut self, behavior: NSNumberFormatterBehavior)
Source§fn m_set_default_formatter_behavior(behavior: NSNumberFormatterBehavior)
fn m_set_default_formatter_behavior(behavior: NSNumberFormatterBehavior)
NSNumberFormatter
.Source§fn m_default_formatter_behavior() -> NSNumberFormatterBehavior
fn m_default_formatter_behavior() -> NSNumberFormatterBehavior
NSNumberFormatterBehavior
constant that indicates default
formatter behavior for new instances of NSNumberFormatter.Source§fn p_number_style(&self) -> NSNumberFormatterStyle
fn p_number_style(&self) -> NSNumberFormatterStyle
Source§fn p_set_number_style(&mut self, style: NSNumberFormatterStyle)
fn p_set_number_style(&mut self, style: NSNumberFormatterStyle)
Source§fn p_generates_decimal_numbers(&self)
fn p_generates_decimal_numbers(&self)
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
fn m_get_object_value_for_string_range_error( &self, obj: id, string: NSString, rangep: NSRange, error: NSError, ) -> bool
Source§fn m_number_from_string(&self, string: NSString) -> NSNumber
fn m_number_from_string(&self, string: NSString) -> NSNumber
NSNumber
object created by parsing a given string.