[][src]Struct intl_pluralrules::operands::PluralOperands

pub struct PluralOperands {
    pub n: f64,
    pub i: isize,
    pub v: isize,
    pub w: isize,
    pub f: isize,
    pub t: isize,
}

A full plural operands representation of a number. See CLDR Plural Rules for complete operands description.

Fields

n: f64

Absolute value of input

i: isize

Integer value of input

v: isize

Number of visible fraction digits with trailing zeros

w: isize

Number of visible fraction digits without trailing zeros

f: isize

Visible fraction digits with trailing zeros

t: isize

Visible fraction digits without trailing zeros

Methods

impl PluralOperands[src]

pub fn from<S: IntoPluralOperands>(num: S) -> Result<Self, &'static str>[src]

Given numerical input (as numeric type or reference), returns the PluralOperands representation of the input.

Example

use intl_pluralrules::operands::*;
assert_eq!(Ok(PluralOperands {
   n: 123.45_f64,
   i: 123,
   v: 2,
   w: 2,
   f: 45,
   t: 45,
}), PluralOperands::from(123.45))

Trait Implementations

impl PartialEq<PluralOperands> for PluralOperands[src]

impl Debug for PluralOperands[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]