pub struct PartNumberBuilder<'vf, T: ValueFormatTrait> { /* private fields */ }Expand description
Builder for FormatPart with type Number.
Implementations§
Source§impl<'vf, T: ValueFormatTrait> PartNumberBuilder<'vf, T>
impl<'vf, T: ValueFormatTrait> PartNumberBuilder<'vf, T>
Sourcepub fn if_then<F>(self, test: bool, build: F) -> Selfwhere
F: Fn(Self) -> Self,
pub fn if_then<F>(self, test: bool, build: F) -> Selfwhere
F: Fn(Self) -> Self,
Only applies the builder if the test is true.
Sourcepub fn decimal_places(self, decimal_places: u8) -> Self
pub fn decimal_places(self, decimal_places: 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.
Sourcepub fn fixed_decimal_places(self, decimal_places: u8) -> Self
pub fn fixed_decimal_places(self, decimal_places: u8) -> Self
Sets decimal_places and min_decimal_places to the same value, which in effect always displays the same number of decimals.
Sourcepub fn grouping(self) -> Self
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.
Sourcepub fn min_decimal_places(self, min_decimal_places: u8) -> Self
pub fn min_decimal_places(self, min_decimal_places: 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.
Sourcepub fn min_integer_digits(self, mininteger_digits: u8) -> Self
pub fn min_integer_digits(self, mininteger_digits: 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.
Sourcepub fn display_factor(self, display_factor: f64) -> Self
pub fn display_factor(self, display_factor: f64) -> Self
The number:display-factor attribute specifies a factor by which each number is scaled (divided) before displaying. The default value for this attribute is 1
Sourcepub fn decimal_replacement(self, decimal_replacement: char) -> Self
pub fn decimal_replacement(self, decimal_replacement: char) -> Self
The number:decimal-replacement attribute specifies a replacement text for decimal places if a number style specifies that decimal places are used but the number displayed is an integer. Note: What replacement text is supported is implementation-dependent
Sourcepub fn embedded_text<S: Into<String>>(self, text: S, pos: i32) -> Self
pub fn embedded_text<S: Into<String>>(self, text: S, pos: i32) -> Self
The number:embedded-text element specifies text that is displayed at one specific position within a number.
The number:embedded-text element is usable within the following element:
- number:number 16.29.3.
The number:embedded-text element has the following attribute:
- number:position 19.358.
The number:position attribute specifies the position where text appears. The index of a position starts with 1 and is counted by digits from right to left in the integer part of a number, starting left from a decimal separator if one exists, or from the last digit of the number. Text is inserted before the digit at the specified position. If the value of number:position attribute is greater than the value of number:min-integer-digits 19.355 and greater than the number of integer digits in the number, text is prepended to the number.
The number:embedded-text element has no child elements. The number:embedded-text element has character data content