Struct icu::decimal::FixedDecimalFormatter
source · pub struct FixedDecimalFormatter { /* private fields */ }
Expand description
A formatter for FixedDecimal
, rendering decimal digits in an i18n-friendly way.
FixedDecimalFormatter
supports:
- Rendering in the local numbering system
- Locale-sensitive grouping separator positions
- Locale-sensitive plus and minus signs
Read more about the options in the options
module.
See the crate-level documentation for examples.
Implementations§
source§impl FixedDecimalFormatter
impl FixedDecimalFormatter
sourcepub fn try_new(
locale: &DataLocale,
options: FixedDecimalFormatterOptions
) -> Result<FixedDecimalFormatter, DecimalError>
pub fn try_new( locale: &DataLocale, options: FixedDecimalFormatterOptions ) -> Result<FixedDecimalFormatter, DecimalError>
Creates a new FixedDecimalFormatter
from compiled data and an options bag.
✨ Enabled with the compiled_data
Cargo feature.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: FixedDecimalFormatterOptions
) -> Result<FixedDecimalFormatter, DecimalError>
pub fn try_new_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: FixedDecimalFormatterOptions ) -> Result<FixedDecimalFormatter, DecimalError>
A version of Self::try_new
that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: FixedDecimalFormatterOptions
) -> Result<FixedDecimalFormatter, DecimalError>
pub fn try_new_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: FixedDecimalFormatterOptions ) -> Result<FixedDecimalFormatter, DecimalError>
A version of Self::try_new
that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
sourcepub fn try_new_unstable<D>(
provider: &D,
locale: &DataLocale,
options: FixedDecimalFormatterOptions
) -> Result<FixedDecimalFormatter, DecimalError>
pub fn try_new_unstable<D>( provider: &D, locale: &DataLocale, options: FixedDecimalFormatterOptions ) -> Result<FixedDecimalFormatter, DecimalError>
A version of Self::try_new
that uses custom data provided by a DataProvider
.
⚠️ The bounds on provider may change over time, including in SemVer minor releases.
sourcepub fn format<'l>(
&'l self,
value: &'l FixedDecimal
) -> FormattedFixedDecimal<'l>
pub fn format<'l>( &'l self, value: &'l FixedDecimal ) -> FormattedFixedDecimal<'l>
Formats a FixedDecimal
, returning a FormattedFixedDecimal
.
sourcepub fn format_to_string(&self, value: &FixedDecimal) -> String
pub fn format_to_string(&self, value: &FixedDecimal) -> String
Formats a FixedDecimal
, returning a String
.
Trait Implementations§
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