Struct icu_capi::fixed_decimal::ffi::ICU4XFixedDecimal

source ·
pub struct ICU4XFixedDecimal(pub FixedDecimal);

Tuple Fields§

§0: FixedDecimal

Implementations§

source§

impl ICU4XFixedDecimal

source

pub fn create_from_i32(v: i32) -> Box<ICU4XFixedDecimal>

Construct an ICU4XFixedDecimal from an integer.

source

pub fn create_from_u32(v: u32) -> Box<ICU4XFixedDecimal>

Construct an ICU4XFixedDecimal from an integer.

source

pub fn create_from_i64(v: i64) -> Box<ICU4XFixedDecimal>

Construct an ICU4XFixedDecimal from an integer.

source

pub fn create_from_u64(v: u64) -> Box<ICU4XFixedDecimal>

Construct an ICU4XFixedDecimal from an integer.

source

pub fn create_from_f64_with_integer_precision( f: f64, ) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>

Construct an ICU4XFixedDecimal from an integer-valued float

source

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

source

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

source

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

source

pub fn create_from_string( v: &DiplomatStr, ) -> Result<Box<ICU4XFixedDecimal>, ICU4XError>

Construct an ICU4XFixedDecimal from a string.

source

pub fn digit_at(&self, magnitude: i16) -> u8

source

pub fn magnitude_start(&self) -> i16

source

pub fn magnitude_end(&self) -> i16

source

pub fn nonzero_magnitude_start(&self) -> i16

source

pub fn nonzero_magnitude_end(&self) -> i16

source

pub fn is_zero(&self) -> bool

source

pub fn multiply_pow10(&mut self, power: i16)

Multiply the ICU4XFixedDecimal by a given power of ten.

source

pub fn sign(&self) -> ICU4XFixedDecimalSign

source

pub fn set_sign(&mut self, sign: ICU4XFixedDecimalSign)

Set the sign of the ICU4XFixedDecimal.

source

pub fn apply_sign_display(&mut self, sign_display: ICU4XFixedDecimalSignDisplay)

source

pub fn trim_start(&mut self)

source

pub fn trim_end(&mut self)

source

pub fn pad_start(&mut self, position: i16)

Zero-pad the ICU4XFixedDecimal on the left to a particular position

source

pub fn pad_end(&mut self, position: i16)

Zero-pad the ICU4XFixedDecimal on the right to a particular position

source

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”)

source

pub fn trunc(&mut self, position: i16)

source

pub fn trunc_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

pub fn half_trunc(&mut self, position: i16)

source

pub fn half_trunc_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

pub fn expand(&mut self, position: i16)

source

pub fn expand_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

pub fn half_expand(&mut self, position: i16)

source

pub fn half_expand_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

pub fn ceil(&mut self, position: i16)

source

pub fn ceil_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

pub fn half_ceil(&mut self, position: i16)

source

pub fn half_ceil_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

pub fn floor(&mut self, position: i16)

source

pub fn floor_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

pub fn half_floor(&mut self, position: i16)

source

pub fn half_floor_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

pub fn half_even(&mut self, position: i16)

source

pub fn half_even_to_increment( &mut self, position: i16, increment: ICU4XRoundingIncrement, )

source

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.

source

pub fn to_string(&self, to: &mut DiplomatWriteable)

Format the ICU4XFixedDecimal as a string.

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> Filterable for T

source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. 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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T