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

Builder for FormatPart with type ScientificNumber.

The number:scientific-number element specifies the display formatting properties for a number style that should be displayed in scientific format.

The number:scientific-number element is usable within the following element:

  • number:number-style 16.27.2.

The number:scientific-number element has the following attributes:

  • number:decimal-places 19.343.4,
  • number:grouping 19.348,
  • number:min-exponentdigits 19.351 and
  • number:min-integer-digits 19.352.

The number:scientific-number element has no child elements.

Implementations§

source§

impl<'vf, T: ValueFormatTrait> PartScientificBuilder<'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 decimal_places(self, v: u8) -> Self

If the number:decimal-places attribute is not specified, the number of decimal places specified by the default table cell style is used.

source

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

The number:exponent-interval attribute determines the valid exponents to be used: the valid exponents are the integer multiples of the value of the number:exponent-interval attribute. The default value for this attribute is 1.

source

pub fn forced_exponent_sign(self, v: bool) -> Self

The number:forced-exponent-sign attribute specifies whether the sign of the exponent for a scientific number is always displayed. The defined values for the number:forced-exponent-sign attribute are:

  • false: the exponent sign is displayed only for a negative value of the exponent, otherwise it is not displayed.
  • true: the exponent sign is always displayed regardless of the value of exponent. The default value for this attribute is true.
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 min_decimal_places(self, v: u8) -> Self

The number:min-decimal-places attribute specifies the minimum number of digits in the decimal part. The value of the number:min-decimal-places attribute shall not be greater than the value of the number:decimal-places 19.343 attribute. If the value of number:min-decimal-places is less than the value of number:decimalplaces, trailing zero digits in decimal places following the position indicated by the value of number:min-decimal-places shall not be displayed.

source

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

The number:min-exponent-digits attribute specifies the minimum number of digits to use to display an exponent.

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.

Trait Implementations§

source§

impl<'vf, T: Debug + ValueFormatTrait> Debug for PartScientificBuilder<'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 PartScientificBuilder<'vf, T>
where T: RefUnwindSafe,

§

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

§

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

§

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

§

impl<'vf, T> !UnwindSafe for PartScientificBuilder<'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.