pub struct MidScaleInt { /* private fields */ }Expand description
Mid-scale integers (中数).
「中数者,万万变之。若言万万曰亿,万万亿曰兆,万万兆曰京也。」
Implementations§
Source§impl MidScaleInt
impl MidScaleInt
Sourcepub fn new_non_pos(abs: u128) -> Self
pub fn new_non_pos(abs: u128) -> Self
Generates a new non-positive mid-scale integer from given absolute value.
There is no way to generate Chinese numerals by From trait from negative primitive numbers less than i128::MIN. This associated function provides a way to generate them from the given absolute value less than or equal to u128::MAX. This crate also provides struct MidScaleBigInt for integers with absolute value larger than u128::MAX.
Trait Implementations§
Source§impl Clone for MidScaleInt
impl Clone for MidScaleInt
Source§fn clone(&self) -> MidScaleInt
fn clone(&self) -> MidScaleInt
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MidScaleInt
impl Debug for MidScaleInt
Source§impl Default for MidScaleInt
impl Default for MidScaleInt
Source§fn default() -> MidScaleInt
fn default() -> MidScaleInt
Returns the “default value” for a type. Read more
Source§impl Display for MidScaleInt
impl Display for MidScaleInt
Source§impl From<i128> for MidScaleInt
impl From<i128> for MidScaleInt
Source§impl From<i16> for MidScaleInt
impl From<i16> for MidScaleInt
Source§impl From<i32> for MidScaleInt
impl From<i32> for MidScaleInt
Source§impl From<i64> for MidScaleInt
impl From<i64> for MidScaleInt
Source§impl From<i8> for MidScaleInt
impl From<i8> for MidScaleInt
Source§impl From<isize> for MidScaleInt
impl From<isize> for MidScaleInt
Source§impl From<u128> for MidScaleInt
impl From<u128> for MidScaleInt
Source§impl From<u16> for MidScaleInt
impl From<u16> for MidScaleInt
Source§impl From<u32> for MidScaleInt
impl From<u32> for MidScaleInt
Source§impl From<u64> for MidScaleInt
impl From<u64> for MidScaleInt
Source§impl From<u8> for MidScaleInt
impl From<u8> for MidScaleInt
Source§impl From<usize> for MidScaleInt
impl From<usize> for MidScaleInt
Source§impl Ord for MidScaleInt
impl Ord for MidScaleInt
Source§fn cmp(&self, other: &MidScaleInt) -> Ordering
fn cmp(&self, other: &MidScaleInt) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MidScaleInt
impl PartialEq for MidScaleInt
Source§fn eq(&self, other: &MidScaleInt) -> bool
fn eq(&self, other: &MidScaleInt) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for MidScaleInt
impl PartialOrd for MidScaleInt
impl Copy for MidScaleInt
impl Eq for MidScaleInt
impl StructuralPartialEq for MidScaleInt
Auto Trait Implementations§
impl Freeze for MidScaleInt
impl RefUnwindSafe for MidScaleInt
impl Send for MidScaleInt
impl Sync for MidScaleInt
impl Unpin for MidScaleInt
impl UnsafeUnpin for MidScaleInt
impl UnwindSafe for MidScaleInt
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> ChineseNumeral for Twhere
T: ChineseNumeralBase,
impl<T> ChineseNumeral for Twhere
T: ChineseNumeralBase,
Source§fn to_lowercase(&self, variant: Variant) -> String
fn to_lowercase(&self, variant: Variant) -> String
Converts the number to lowercase (小写数字, used for normal contexts).
Source§fn to_uppercase(&self, variant: Variant) -> String
fn to_uppercase(&self, variant: Variant) -> String
Converts the number to uppercase (大写数字, used for financial contexts).
Source§fn to_lowercase_simp(&self) -> String
fn to_lowercase_simp(&self) -> String
Converts the number to lowercase (小写数字, used for normal contexts) in simplified Chinese.
Source§fn to_lowercase_trad(&self) -> String
fn to_lowercase_trad(&self) -> String
Converts the number to lowercase (小写数字, used for normal contexts) in traditional Chinese.
Source§fn to_uppercase_simp(&self) -> String
fn to_uppercase_simp(&self) -> String
Converts the number to uppercase (大写数字, used for financial contexts) in simplified Chinese.
Source§fn to_uppercase_trad(&self) -> String
fn to_uppercase_trad(&self) -> String
Converts the number to uppercase (大写数字, used for financial contexts) in traditional Chinese.