Struct format_num_pattern::NumberSymbols

source ·
pub struct NumberSymbols {
    pub decimal_sep: char,
    pub decimal_grp: Option<char>,
    pub negative_sym: char,
    pub positive_sym: char,
    pub exponent_upper_sym: char,
    pub exponent_lower_sym: char,
    pub currency_sym: CurrencySym,
}
Expand description

Symbols for number formatting.

Fields§

§decimal_sep: char

Decimal separator

§decimal_grp: Option<char>

Decimal grouping

§negative_sym: char

Minus sign

§positive_sym: char

Plus sign

§exponent_upper_sym: char

Exponent

§exponent_lower_sym: char

Exponent

§currency_sym: CurrencySym

Currency

Implementations§

source§

impl NumberSymbols

source

pub const fn new() -> Self

source

pub fn numeric(locale: Locale) -> Self

Uses the locale information provided by pure_rust_locales.

This function sets

  • decimal_sep to LC_NUMERIC::DECIMAL_POINT,
  • decimal_grp to LC_NUMERIC::THOUSANDS_SEP Fills the rest with defaults.
source

pub fn monetary(locale: Locale) -> Self

Uses the locale information provided by pure_rust_locales.

This function sets

  • decimal_sep to LC_MONETARY::MON_DECIMAL_POINT,
  • decimal_grp to LC_MONETARY::MON_THOUSANDS_SEP
  • negative_sym to LC_MONETARY::NEGATIVE_SIGN
  • positive_sym to LC_MONETARY::POSITIVE_SIGN
  • currency_sym to LC_MONETARY::CURRENCY_SYMBOL Fills the rest with defaults.
source

pub fn int_monetary(locale: Locale) -> Self

Uses the locale information provided by pure_rust_locales.

This function sets

  • decimal_sep to LC_MONETARY::MON_DECIMAL_POINT,
  • decimal_grp to LC_MONETARY::MON_THOUSANDS_SEP
  • negative_sym to LC_MONETARY::NEGATIVE_SIGN
  • positive_sym to LC_MONETARY::POSITIVE_SIGN
  • currency_sym to LC_MONETARY::INT_CURR_SYMBOL Fills the rest with defaults.

Trait Implementations§

source§

impl Clone for NumberSymbols

source§

fn clone(&self) -> NumberSymbols

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for NumberSymbols

source§

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

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

impl Default for NumberSymbols

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for NumberSymbols

source§

fn eq(&self, other: &NumberSymbols) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for NumberSymbols

source§

impl Eq for NumberSymbols

source§

impl StructuralPartialEq for NumberSymbols

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> 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<T> ToOwned for T
where T: Clone,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.