pub struct DecimalFormatter(pub DecimalFormatter);
Expand description
An ICU4X Decimal Format object, capable of formatting a Decimal
as a string.
Tuple Fields§
§0: DecimalFormatter
Implementations§
Source§impl DecimalFormatter
impl DecimalFormatter
Sourcepub fn create_with_grouping_strategy(
locale: &Locale,
grouping_strategy: Option<DecimalGroupingStrategy>,
) -> Result<Box<DecimalFormatter>, DataError>
pub fn create_with_grouping_strategy( locale: &Locale, grouping_strategy: Option<DecimalGroupingStrategy>, ) -> Result<Box<DecimalFormatter>, DataError>
Creates a new DecimalFormatter
, using compiled data
Sourcepub fn create_with_grouping_strategy_and_provider(
provider: &DataProvider,
locale: &Locale,
grouping_strategy: Option<DecimalGroupingStrategy>,
) -> Result<Box<DecimalFormatter>, DataError>
pub fn create_with_grouping_strategy_and_provider( provider: &DataProvider, locale: &Locale, grouping_strategy: Option<DecimalGroupingStrategy>, ) -> Result<Box<DecimalFormatter>, DataError>
Creates a new DecimalFormatter
, using a particular data source.
Sourcepub fn create_with_manual_data(
plus_sign_prefix: &DiplomatStr,
plus_sign_suffix: &DiplomatStr,
minus_sign_prefix: &DiplomatStr,
minus_sign_suffix: &DiplomatStr,
decimal_separator: &DiplomatStr,
grouping_separator: &DiplomatStr,
primary_group_size: u8,
secondary_group_size: u8,
min_group_size: u8,
digits: &[DiplomatChar],
grouping_strategy: Option<DecimalGroupingStrategy>,
) -> Result<Box<DecimalFormatter>, DataError>
pub fn create_with_manual_data( plus_sign_prefix: &DiplomatStr, plus_sign_suffix: &DiplomatStr, minus_sign_prefix: &DiplomatStr, minus_sign_suffix: &DiplomatStr, decimal_separator: &DiplomatStr, grouping_separator: &DiplomatStr, primary_group_size: u8, secondary_group_size: u8, min_group_size: u8, digits: &[DiplomatChar], grouping_strategy: Option<DecimalGroupingStrategy>, ) -> Result<Box<DecimalFormatter>, DataError>
Creates a new DecimalFormatter
from preconstructed locale data.
Auto Trait Implementations§
impl Freeze for DecimalFormatter
impl RefUnwindSafe for DecimalFormatter
impl Send for DecimalFormatter
impl Sync for DecimalFormatter
impl Unpin for DecimalFormatter
impl UnwindSafe for DecimalFormatter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more