Struct icu_plurals::PluralOperands [−][src]
pub struct PluralOperands { pub i: u64, pub v: usize, pub w: usize, pub f: u64, pub t: u64, pub c: usize, }
A full plural operands representation of a number. See CLDR Plural Rules for complete operands description. Plural operands in compliance with CLDR Plural Rules.
See full operands description.
Examples
From int
use icu::plurals::PluralOperands; assert_eq!(PluralOperands { i: 2, v: 0, w: 0, f: 0, t: 0, c: 0, }, PluralOperands::from(2_usize))
From float
use std::str::FromStr; use icu::plurals::PluralOperands; assert_eq!(Ok(PluralOperands { i: 1234, v: 3, w: 3, f: 567, t: 567, c: 0, }), "-1234.567".parse())
From &str
use std::convert::TryFrom; use icu::plurals::PluralOperands; assert_eq!(Ok(PluralOperands { i: 123, v: 2, w: 2, f: 45, t: 45, c: 0, }), "123.45".parse())
Fields
i: u64
Integer value of input
v: usize
Number of visible fraction digits with trailing zeros
w: usize
Number of visible fraction digits without trailing zeros
f: u64
Visible fraction digits with trailing zeros
t: u64
Visible fraction digits without trailing zeros
c: usize
Exponent of the power of 10 used in compact decimal formatting
Implementations
impl PluralOperands
[src]
impl PluralOperands
[src]pub fn n(&self) -> f64
[src]
Returns the number represented by this PluralOperands
as floating point.
The precision of the number returned is up to the representation accuracy
of a double.
Trait Implementations
impl Clone for PluralOperands
[src]
impl Clone for PluralOperands
[src]fn clone(&self) -> PluralOperands
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PluralOperands
[src]
impl Copy for PluralOperands
[src]impl From<&'_ FixedDecimal> for PluralOperands
[src]
impl From<&'_ FixedDecimal> for PluralOperands
[src]fn from(dec: &FixedDecimal) -> Self
[src]
Converts a fixed_decimal::FixedDecimal
to PluralOperands
. Retains at most 18
digits each from the integer and fraction parts.
impl FromStr for PluralOperands
[src]
impl FromStr for PluralOperands
[src]impl PartialEq<PluralOperands> for PluralOperands
[src]
impl PartialEq<PluralOperands> for PluralOperands
[src]fn eq(&self, other: &PluralOperands) -> bool
[src]
fn ne(&self, other: &PluralOperands) -> bool
[src]
impl StructuralPartialEq for PluralOperands
[src]
impl StructuralPartialEq for PluralOperands
[src]impl TryFrom<i128> for PluralOperands
[src]
impl TryFrom<i128> for PluralOperands
[src]impl TryFrom<i16> for PluralOperands
[src]
impl TryFrom<i16> for PluralOperands
[src]impl TryFrom<i32> for PluralOperands
[src]
impl TryFrom<i32> for PluralOperands
[src]impl TryFrom<i64> for PluralOperands
[src]
impl TryFrom<i64> for PluralOperands
[src]impl TryFrom<i8> for PluralOperands
[src]
impl TryFrom<i8> for PluralOperands
[src]Auto Trait Implementations
impl RefUnwindSafe for PluralOperands
impl RefUnwindSafe for PluralOperands
impl Send for PluralOperands
impl Send for PluralOperands
impl Sync for PluralOperands
impl Sync for PluralOperands
impl Unpin for PluralOperands
impl Unpin for PluralOperands
impl UnwindSafe for PluralOperands
impl UnwindSafe for PluralOperands