pub struct PartFractionBuilder<'vf, T: ValueFormatTrait> { /* private fields */ }
Expand description

The number:fraction element specifies the display formatting properties for a number style that should be displayed as a fraction.

The number:fraction element is usable within the following element:

  • number:numberstyle 16.29.2.

The number:fraction element has the following attributes:

  • number:denominatorvalue 19.345,
  • number:grouping 19.350,
  • number:max-denominator-value 19.352,
  • number:min-denominator-digits 19.353,
  • number:min-integer-digits 19.355 and
  • number:min-numerator-digits 19.357.

The number:fraction element has no child elements.

Implementations§

source§

impl<'vf, T: ValueFormatTrait> PartFractionBuilder<'vf, T>

source

pub fn new<'a>(valueformat: &'a mut T) -> Self
where 'a: 'vf,

New builder for the valueformat.

source

pub fn build(self)

Appends the constructed FormatPart to the original value format.

source

pub fn if_then<F>(self, test: bool, build: F) -> Self
where F: Fn(Self) -> Self,

Only applies the builder if the test is true.

source

pub fn denominator(self, v: i64) -> Self

The number:denominator-value attribute specifies an integer value that is used as the denominator of a fraction. If this attribute is not present, a denominator that is appropriate for displaying the number is used.

source

pub fn grouping(self) -> Self

The number:grouping attribute specifies whether the integer digits of a number should be grouped using a separator character. The grouping character that is used and the number of digits that are grouped together depends on the language and country of the style. The defined values for the number:grouping attribute are:

  • false: integer digits of a number are not grouped using a separator character.
  • true: integer digits of a number should be grouped by a separator character. The default value for this attribute is false.
source

pub fn max_denominator(self, v: i64) -> Self

The number:max-denominator-value attribute specifies the maximum denominator permitted to be chosen if its number:fraction element does not have a number:denominator-value attribute. The number:max-denominator-value attribute is ignored in the presence of a number:denominator-value 19.345 attribute. The absence of the number:max-denominator-value attribute indicates that no maximum denominator is specified.

source

pub fn min_denominator_digits(self, v: u8) -> Self

The number:min-denominator-digits attribute specifies the minimum number of digits to use to display the denominator of a fraction.

source

pub fn min_integer_digits(self, v: u8) -> Self

The number:min-integer-digits attribute specifies the minimum number of integer digits to display in the integer portion of a number, a scientific number, or a fraction. For a number:fraction element, if the number:min-integer-digits attribute is not present, no integer portion is displayed.

source

pub fn min_numerator_digits(self, v: u8) -> Self

The number:min-numerator-digits attribute specifies the minimum number of digits to use to display the numerator in a fraction.

Trait Implementations§

source§

impl<'vf, T: Debug + ValueFormatTrait> Debug for PartFractionBuilder<'vf, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'vf, T> RefUnwindSafe for PartFractionBuilder<'vf, T>
where T: RefUnwindSafe,

§

impl<'vf, T> Send for PartFractionBuilder<'vf, T>
where T: Send,

§

impl<'vf, T> Sync for PartFractionBuilder<'vf, T>
where T: Sync,

§

impl<'vf, T> Unpin for PartFractionBuilder<'vf, T>

§

impl<'vf, T> !UnwindSafe for PartFractionBuilder<'vf, T>

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> 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, 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.