Struct icu_capi::decimal::ffi::FixedDecimalFormatter
source · pub struct FixedDecimalFormatter(pub FixedDecimalFormatter);
Expand description
An ICU4X Fixed Decimal Format object, capable of formatting a FixedDecimal
as a string.
Tuple Fields§
§0: FixedDecimalFormatter
Implementations§
source§impl FixedDecimalFormatter
impl FixedDecimalFormatter
sourcepub fn create_with_grouping_strategy(
provider: &DataProvider,
locale: &Locale,
grouping_strategy: Option<FixedDecimalGroupingStrategy>,
) -> Result<Box<FixedDecimalFormatter>, DataError>
pub fn create_with_grouping_strategy( provider: &DataProvider, locale: &Locale, grouping_strategy: Option<FixedDecimalGroupingStrategy>, ) -> Result<Box<FixedDecimalFormatter>, DataError>
Creates a new FixedDecimalFormatter
from locale data.
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<FixedDecimalGroupingStrategy>,
) -> Result<Box<FixedDecimalFormatter>, 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<FixedDecimalGroupingStrategy>, ) -> Result<Box<FixedDecimalFormatter>, DataError>
Creates a new FixedDecimalFormatter
from preconstructed locale data.
sourcepub fn format(&self, value: &FixedDecimal, write: &mut DiplomatWrite)
pub fn format(&self, value: &FixedDecimal, write: &mut DiplomatWrite)
Formats a FixedDecimal
to a string.
Auto Trait Implementations§
impl Freeze for FixedDecimalFormatter
impl RefUnwindSafe for FixedDecimalFormatter
impl Send for FixedDecimalFormatter
impl Sync for FixedDecimalFormatter
impl Unpin for FixedDecimalFormatter
impl UnwindSafe for FixedDecimalFormatter
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