Struct icu_capi::fixed_decimal::ffi::ICU4XFixedDecimal
source · pub struct ICU4XFixedDecimal(pub FixedDecimal);
Tuple Fields§
§0: FixedDecimal
Implementations§
source§impl ICU4XFixedDecimal
impl ICU4XFixedDecimal
sourcepub fn create_from_i32(v: i32) -> Box<ICU4XFixedDecimal>
pub fn create_from_i32(v: i32) -> Box<ICU4XFixedDecimal>
Construct an ICU4XFixedDecimal
from an integer.
sourcepub fn create_from_u32(v: u32) -> Box<ICU4XFixedDecimal>
pub fn create_from_u32(v: u32) -> Box<ICU4XFixedDecimal>
Construct an ICU4XFixedDecimal
from an integer.
sourcepub fn create_from_i64(v: i64) -> Box<ICU4XFixedDecimal>
pub fn create_from_i64(v: i64) -> Box<ICU4XFixedDecimal>
Construct an ICU4XFixedDecimal
from an integer.
sourcepub fn create_from_u64(v: u64) -> Box<ICU4XFixedDecimal>
pub fn create_from_u64(v: u64) -> Box<ICU4XFixedDecimal>
Construct an ICU4XFixedDecimal
from an integer.
sourcepub fn create_from_f64_with_integer_precision(
f: f64,
) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
pub fn create_from_f64_with_integer_precision( f: f64, ) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
Construct an ICU4XFixedDecimal
from an integer-valued float
sourcepub fn create_from_f64_with_lower_magnitude(
f: f64,
magnitude: i16,
) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
pub fn create_from_f64_with_lower_magnitude( f: f64, magnitude: i16, ) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
Construct an ICU4XFixedDecimal
from an float, with a given power of 10 for the lower magnitude
sourcepub fn create_from_f64_with_significant_digits(
f: f64,
digits: u8,
) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
pub fn create_from_f64_with_significant_digits( f: f64, digits: u8, ) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
Construct an ICU4XFixedDecimal
from an float, for a given number of significant digits
sourcepub fn create_from_f64_with_floating_precision(
f: f64,
) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
pub fn create_from_f64_with_floating_precision( f: f64, ) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
Construct an ICU4XFixedDecimal
from an float, with enough digits to recover
the original floating point in IEEE 754 without needing trailing zeros
sourcepub fn create_from_string(
v: &DiplomatStr,
) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
pub fn create_from_string( v: &DiplomatStr, ) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>
Construct an ICU4XFixedDecimal
from a string.
pub fn digit_at(&self, magnitude: i16) -> u8
pub fn magnitude_start(&self) -> i16
pub fn magnitude_end(&self) -> i16
pub fn nonzero_magnitude_start(&self) -> i16
pub fn nonzero_magnitude_end(&self) -> i16
pub fn is_zero(&self) -> bool
sourcepub fn multiply_pow10(&mut self, power: i16)
pub fn multiply_pow10(&mut self, power: i16)
Multiply the ICU4XFixedDecimal
by a given power of ten.
pub fn sign(&self) -> ICU4XFixedDecimalSign
sourcepub fn set_sign(&mut self, sign: ICU4XFixedDecimalSign)
pub fn set_sign(&mut self, sign: ICU4XFixedDecimalSign)
Set the sign of the ICU4XFixedDecimal
.
pub fn apply_sign_display(&mut self, sign_display: ICU4XFixedDecimalSignDisplay)
pub fn trim_start(&mut self)
pub fn trim_end(&mut self)
sourcepub fn pad_start(&mut self, position: i16)
pub fn pad_start(&mut self, position: i16)
Zero-pad the ICU4XFixedDecimal
on the left to a particular position
sourcepub fn pad_end(&mut self, position: i16)
pub fn pad_end(&mut self, position: i16)
Zero-pad the ICU4XFixedDecimal
on the right to a particular position
sourcepub fn set_max_position(&mut self, position: i16)
pub fn set_max_position(&mut self, position: i16)
Truncate the ICU4XFixedDecimal
on the left to a particular position, deleting digits if necessary. This is useful for, e.g. abbreviating years
(“2022” -> “22”)
pub fn trunc(&mut self, position: i16)
pub fn trunc_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
pub fn half_trunc(&mut self, position: i16)
pub fn half_trunc_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
pub fn expand(&mut self, position: i16)
pub fn expand_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
pub fn half_expand(&mut self, position: i16)
pub fn half_expand_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
pub fn ceil(&mut self, position: i16)
pub fn ceil_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
pub fn half_ceil(&mut self, position: i16)
pub fn half_ceil_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
pub fn floor(&mut self, position: i16)
pub fn floor_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
pub fn half_floor(&mut self, position: i16)
pub fn half_floor_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
pub fn half_even(&mut self, position: i16)
pub fn half_even_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )
sourcepub fn concatenate_end(
&mut self,
other: &mut ICU4XFixedDecimal,
) -> Result<(), ()>
pub fn concatenate_end( &mut self, other: &mut ICU4XFixedDecimal, ) -> Result<(), ()>
Concatenates other
to the end of self
.
If successful, other
will be set to 0 and a successful status is returned.
If not successful, other
will be unchanged and an error is returned.
sourcepub fn to_string(&self, to: &mut DiplomatWriteable)
pub fn to_string(&self, to: &mut DiplomatWriteable)
Format the ICU4XFixedDecimal
as a string.
Auto Trait Implementations§
impl Freeze for ICU4XFixedDecimal
impl RefUnwindSafe for ICU4XFixedDecimal
impl Send for ICU4XFixedDecimal
impl Sync for ICU4XFixedDecimal
impl Unpin for ICU4XFixedDecimal
impl UnwindSafe for ICU4XFixedDecimal
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
source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
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>
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>
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