ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
ICU4XFixedDecimal Class Reference

#include <ICU4XFixedDecimal.hpp>

Public Member Functions

uint8_t digit_at (int16_t magnitude) const
 
int16_t magnitude_start () const
 
int16_t magnitude_end () const
 
int16_t nonzero_magnitude_start () const
 
int16_t nonzero_magnitude_end () const
 
bool is_zero () const
 
void multiply_pow10 (int16_t power)
 
ICU4XFixedDecimalSign sign () const
 
void set_sign (ICU4XFixedDecimalSign sign)
 
void apply_sign_display (ICU4XFixedDecimalSignDisplay sign_display)
 
void trim_start ()
 
void trim_end ()
 
void pad_start (int16_t position)
 
void pad_end (int16_t position)
 
void set_max_position (int16_t position)
 
void trunc (int16_t position)
 
void trunc_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
void half_trunc (int16_t position)
 
void half_trunc_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
void expand (int16_t position)
 
void expand_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
void half_expand (int16_t position)
 
void half_expand_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
void ceil (int16_t position)
 
void ceil_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
void half_ceil (int16_t position)
 
void half_ceil_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
void floor (int16_t position)
 
void floor_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
void half_floor (int16_t position)
 
void half_floor_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
void half_even (int16_t position)
 
void half_even_to_increment (int16_t position, ICU4XRoundingIncrement increment)
 
diplomat::result< std::monostate, std::monostate > concatenate_end (ICU4XFixedDecimal &other)
 
template<typename W >
void to_string_to_writeable (W &to) const
 
std::string to_string () const
 
 ICU4XFixedDecimal (capi::ICU4XFixedDecimal *i)
 
 ICU4XFixedDecimal ()=default
 
 ICU4XFixedDecimal (ICU4XFixedDecimal &&) noexcept=default
 
ICU4XFixedDecimaloperator= (ICU4XFixedDecimal &&other) noexcept=default
 

Static Public Member Functions

static ICU4XFixedDecimal create_from_i32 (int32_t v)
 
static ICU4XFixedDecimal create_from_u32 (uint32_t v)
 
static ICU4XFixedDecimal create_from_i64 (int64_t v)
 
static ICU4XFixedDecimal create_from_u64 (uint64_t v)
 
static diplomat::result< ICU4XFixedDecimal, ICU4XErrorcreate_from_f64_with_integer_precision (double f)
 
static diplomat::result< ICU4XFixedDecimal, ICU4XErrorcreate_from_f64_with_lower_magnitude (double f, int16_t magnitude)
 
static diplomat::result< ICU4XFixedDecimal, ICU4XErrorcreate_from_f64_with_significant_digits (double f, uint8_t digits)
 
static diplomat::result< ICU4XFixedDecimal, ICU4XErrorcreate_from_f64_with_floating_precision (double f)
 
static diplomat::result< ICU4XFixedDecimal, ICU4XErrorcreate_from_string (const std::string_view v)
 

Detailed Description

See the Rust documentation for FixedDecimal for more information.

Constructor & Destructor Documentation

◆ ICU4XFixedDecimal() [1/3]

ICU4XFixedDecimal::ICU4XFixedDecimal ( capi::ICU4XFixedDecimal *  i)
inlineexplicit

◆ ICU4XFixedDecimal() [2/3]

ICU4XFixedDecimal::ICU4XFixedDecimal ( )
default

◆ ICU4XFixedDecimal() [3/3]

ICU4XFixedDecimal::ICU4XFixedDecimal ( ICU4XFixedDecimal &&  )
defaultnoexcept

Member Function Documentation

◆ apply_sign_display()

void ICU4XFixedDecimal::apply_sign_display ( ICU4XFixedDecimalSignDisplay  sign_display)
inline

See the Rust documentation for apply_sign_display for more information.

◆ ceil()

void ICU4XFixedDecimal::ceil ( int16_t  position)
inline

See the Rust documentation for ceil for more information.

◆ ceil_to_increment()

void ICU4XFixedDecimal::ceil_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for ceil_to_increment for more information.

◆ concatenate_end()

diplomat::result< std::monostate, std::monostate > ICU4XFixedDecimal::concatenate_end ( ICU4XFixedDecimal other)
inline

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.

See the Rust documentation for concatenate_end for more information.

◆ create_from_f64_with_floating_precision()

diplomat::result< ICU4XFixedDecimal, ICU4XError > ICU4XFixedDecimal::create_from_f64_with_floating_precision ( double  f)
inlinestatic

Construct an [ICU4XFixedDecimal] from an float, with enough digits to recover the original floating point in IEEE 754 without needing trailing zeros

See the Rust documentation for try_from_f64 for more information.

See the Rust documentation for FloatPrecision for more information.

◆ create_from_f64_with_integer_precision()

diplomat::result< ICU4XFixedDecimal, ICU4XError > ICU4XFixedDecimal::create_from_f64_with_integer_precision ( double  f)
inlinestatic

Construct an [ICU4XFixedDecimal] from an integer-valued float

See the Rust documentation for try_from_f64 for more information.

See the Rust documentation for FloatPrecision for more information.

◆ create_from_f64_with_lower_magnitude()

diplomat::result< ICU4XFixedDecimal, ICU4XError > ICU4XFixedDecimal::create_from_f64_with_lower_magnitude ( double  f,
int16_t  magnitude 
)
inlinestatic

Construct an [ICU4XFixedDecimal] from an float, with a given power of 10 for the lower magnitude

See the Rust documentation for try_from_f64 for more information.

See the Rust documentation for FloatPrecision for more information.

◆ create_from_f64_with_significant_digits()

diplomat::result< ICU4XFixedDecimal, ICU4XError > ICU4XFixedDecimal::create_from_f64_with_significant_digits ( double  f,
uint8_t  digits 
)
inlinestatic

Construct an [ICU4XFixedDecimal] from an float, for a given number of significant digits

See the Rust documentation for try_from_f64 for more information.

See the Rust documentation for FloatPrecision for more information.

◆ create_from_i32()

ICU4XFixedDecimal ICU4XFixedDecimal::create_from_i32 ( int32_t  v)
inlinestatic

Construct an [ICU4XFixedDecimal] from an integer.

See the Rust documentation for FixedDecimal for more information.

◆ create_from_i64()

ICU4XFixedDecimal ICU4XFixedDecimal::create_from_i64 ( int64_t  v)
inlinestatic

Construct an [ICU4XFixedDecimal] from an integer.

See the Rust documentation for FixedDecimal for more information.

◆ create_from_string()

diplomat::result< ICU4XFixedDecimal, ICU4XError > ICU4XFixedDecimal::create_from_string ( const std::string_view  v)
inlinestatic

Construct an [ICU4XFixedDecimal] from a string.

See the Rust documentation for from_str for more information.

◆ create_from_u32()

ICU4XFixedDecimal ICU4XFixedDecimal::create_from_u32 ( uint32_t  v)
inlinestatic

Construct an [ICU4XFixedDecimal] from an integer.

See the Rust documentation for FixedDecimal for more information.

◆ create_from_u64()

ICU4XFixedDecimal ICU4XFixedDecimal::create_from_u64 ( uint64_t  v)
inlinestatic

Construct an [ICU4XFixedDecimal] from an integer.

See the Rust documentation for FixedDecimal for more information.

◆ digit_at()

uint8_t ICU4XFixedDecimal::digit_at ( int16_t  magnitude) const
inline

See the Rust documentation for digit_at for more information.

◆ expand()

void ICU4XFixedDecimal::expand ( int16_t  position)
inline

See the Rust documentation for expand for more information.

◆ expand_to_increment()

void ICU4XFixedDecimal::expand_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for expand_to_increment for more information.

◆ floor()

void ICU4XFixedDecimal::floor ( int16_t  position)
inline

See the Rust documentation for floor for more information.

◆ floor_to_increment()

void ICU4XFixedDecimal::floor_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for floor_to_increment for more information.

◆ half_ceil()

void ICU4XFixedDecimal::half_ceil ( int16_t  position)
inline

See the Rust documentation for half_ceil for more information.

◆ half_ceil_to_increment()

void ICU4XFixedDecimal::half_ceil_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for half_ceil_to_increment for more information.

◆ half_even()

void ICU4XFixedDecimal::half_even ( int16_t  position)
inline

See the Rust documentation for half_even for more information.

◆ half_even_to_increment()

void ICU4XFixedDecimal::half_even_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for half_even_to_increment for more information.

◆ half_expand()

void ICU4XFixedDecimal::half_expand ( int16_t  position)
inline

See the Rust documentation for half_expand for more information.

◆ half_expand_to_increment()

void ICU4XFixedDecimal::half_expand_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for half_expand_to_increment for more information.

◆ half_floor()

void ICU4XFixedDecimal::half_floor ( int16_t  position)
inline

See the Rust documentation for half_floor for more information.

◆ half_floor_to_increment()

void ICU4XFixedDecimal::half_floor_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for half_floor_to_increment for more information.

◆ half_trunc()

void ICU4XFixedDecimal::half_trunc ( int16_t  position)
inline

See the Rust documentation for half_trunc for more information.

◆ half_trunc_to_increment()

void ICU4XFixedDecimal::half_trunc_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for half_trunc_to_increment for more information.

◆ is_zero()

bool ICU4XFixedDecimal::is_zero ( ) const
inline

See the Rust documentation for is_zero for more information.

◆ magnitude_end()

int16_t ICU4XFixedDecimal::magnitude_end ( ) const
inline

See the Rust documentation for magnitude_range for more information.

◆ magnitude_start()

int16_t ICU4XFixedDecimal::magnitude_start ( ) const
inline

See the Rust documentation for magnitude_range for more information.

◆ multiply_pow10()

void ICU4XFixedDecimal::multiply_pow10 ( int16_t  power)
inline

Multiply the [ICU4XFixedDecimal] by a given power of ten.

See the Rust documentation for multiply_pow10 for more information.

◆ nonzero_magnitude_end()

int16_t ICU4XFixedDecimal::nonzero_magnitude_end ( ) const
inline

See the Rust documentation for nonzero_magnitude_end for more information.

◆ nonzero_magnitude_start()

int16_t ICU4XFixedDecimal::nonzero_magnitude_start ( ) const
inline

See the Rust documentation for nonzero_magnitude_start for more information.

◆ operator=()

ICU4XFixedDecimal & ICU4XFixedDecimal::operator= ( ICU4XFixedDecimal &&  other)
defaultnoexcept

◆ pad_end()

void ICU4XFixedDecimal::pad_end ( int16_t  position)
inline

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

See the Rust documentation for pad_end for more information.

◆ pad_start()

void ICU4XFixedDecimal::pad_start ( int16_t  position)
inline

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

See the Rust documentation for pad_start for more information.

◆ set_max_position()

void ICU4XFixedDecimal::set_max_position ( int16_t  position)
inline

Truncate the [ICU4XFixedDecimal] on the left to a particular position, deleting digits if necessary. This is useful for, e.g. abbreviating years ("2022" -> "22")

See the Rust documentation for set_max_position for more information.

◆ set_sign()

void ICU4XFixedDecimal::set_sign ( ICU4XFixedDecimalSign  sign)
inline

Set the sign of the [ICU4XFixedDecimal].

See the Rust documentation for set_sign for more information.

◆ sign()

ICU4XFixedDecimalSign ICU4XFixedDecimal::sign ( ) const
inline

See the Rust documentation for sign for more information.

◆ to_string()

std::string ICU4XFixedDecimal::to_string ( ) const
inline

Format the [ICU4XFixedDecimal] as a string.

See the Rust documentation for write_to for more information.

◆ to_string_to_writeable()

template<typename W >
void ICU4XFixedDecimal::to_string_to_writeable ( W &  to) const
inline

Format the [ICU4XFixedDecimal] as a string.

See the Rust documentation for write_to for more information.

◆ trim_end()

void ICU4XFixedDecimal::trim_end ( )
inline

See the Rust documentation for trim_end for more information.

◆ trim_start()

void ICU4XFixedDecimal::trim_start ( )
inline

See the Rust documentation for trim_start for more information.

◆ trunc()

void ICU4XFixedDecimal::trunc ( int16_t  position)
inline

See the Rust documentation for trunc for more information.

◆ trunc_to_increment()

void ICU4XFixedDecimal::trunc_to_increment ( int16_t  position,
ICU4XRoundingIncrement  increment 
)
inline

See the Rust documentation for trunc_to_increment for more information.


The documentation for this class was generated from the following file: