Struct etop_format::number_format::NumberFormat
source · pub struct NumberFormat {
pub zero_padding: bool,
pub fill: char,
pub align: NumberAlign,
pub sign: Sign,
pub type_prefix: bool,
pub min_width: usize,
pub max_width: usize,
pub commas: bool,
pub precision: usize,
pub format_type: FormatType,
pub timezone: Timezone,
}Expand description
Represents a destructured specification of a provided format pattern string.
Fields§
§zero_padding: boolzero padding
fill: charfill character
align: NumberAlignalignment
sign: Signsign
type_prefix: booltype prefix
min_width: usizemin_width
max_width: usizemax_width
commas: boolcommas
precision: usizedecimals
format_type: FormatTypeformat type
timezone: Timezonetimezone
Implementations§
source§impl NumberFormat
impl NumberFormat
sourcepub fn new() -> NumberFormat
pub fn new() -> NumberFormat
create new number format
sourcepub fn zero_padding(self) -> NumberFormat
pub fn zero_padding(self) -> NumberFormat
add zero padding
sourcepub fn no_zero_padding(self) -> NumberFormat
pub fn no_zero_padding(self) -> NumberFormat
remove zero padding
sourcepub fn fill(self, fill_char: char) -> NumberFormat
pub fn fill(self, fill_char: char) -> NumberFormat
set fill char
sourcepub fn left_align(self) -> NumberFormat
pub fn left_align(self) -> NumberFormat
left align
sourcepub fn right_align(self) -> NumberFormat
pub fn right_align(self) -> NumberFormat
right align
sourcepub fn center_align(self) -> NumberFormat
pub fn center_align(self) -> NumberFormat
center align
sourcepub fn left_sign_right_align(self) -> NumberFormat
pub fn left_sign_right_align(self) -> NumberFormat
signed right align
sourcepub fn unsigned(self) -> NumberFormat
pub fn unsigned(self) -> NumberFormat
always add sign
sourcepub fn signed(self) -> NumberFormat
pub fn signed(self) -> NumberFormat
always add sign
sourcepub fn unsigned_space(self) -> NumberFormat
pub fn unsigned_space(self) -> NumberFormat
unsigned but with space
sourcepub fn type_prefix(self) -> NumberFormat
pub fn type_prefix(self) -> NumberFormat
add type prefix
sourcepub fn no_type_prefix(self) -> NumberFormat
pub fn no_type_prefix(self) -> NumberFormat
no type prefix
sourcepub fn width(self, width: usize) -> NumberFormat
pub fn width(self, width: usize) -> NumberFormat
set width
sourcepub fn min_width(self, min_width: usize) -> NumberFormat
pub fn min_width(self, min_width: usize) -> NumberFormat
set min_width
sourcepub fn max_width(self, max_width: usize) -> NumberFormat
pub fn max_width(self, max_width: usize) -> NumberFormat
set max_width
sourcepub fn width_option(self, width: Option<usize>) -> NumberFormat
pub fn width_option(self, width: Option<usize>) -> NumberFormat
set width
sourcepub fn min_width_option(self, width: Option<usize>) -> NumberFormat
pub fn min_width_option(self, width: Option<usize>) -> NumberFormat
set min_width
sourcepub fn max_width_option(self, width: Option<usize>) -> NumberFormat
pub fn max_width_option(self, width: Option<usize>) -> NumberFormat
set max_width
sourcepub fn commas(self) -> NumberFormat
pub fn commas(self) -> NumberFormat
show commas
sourcepub fn no_commas(self) -> NumberFormat
pub fn no_commas(self) -> NumberFormat
do not show commas
sourcepub fn precision(self, precision: usize) -> NumberFormat
pub fn precision(self, precision: usize) -> NumberFormat
set precision
sourcepub fn timezone_local(self) -> NumberFormat
pub fn timezone_local(self) -> NumberFormat
use local timezone
sourcepub fn timezone_utc(self) -> NumberFormat
pub fn timezone_utc(self) -> NumberFormat
use utc timezone
sourcepub fn scientific_notation(self) -> NumberFormat
pub fn scientific_notation(self) -> NumberFormat
format as scientific notation
sourcepub fn si(self) -> NumberFormat
pub fn si(self) -> NumberFormat
format as SI (order of magnitude)
sourcepub fn percentage(self) -> NumberFormat
pub fn percentage(self) -> NumberFormat
format as pecentage
sourcepub fn binary(self) -> NumberFormat
pub fn binary(self) -> NumberFormat
format as binary
sourcepub fn octal(self) -> NumberFormat
pub fn octal(self) -> NumberFormat
format as octal
sourcepub fn hex(self) -> NumberFormat
pub fn hex(self) -> NumberFormat
format as hex
sourcepub fn integer_oom(self) -> NumberFormat
pub fn integer_oom(self) -> NumberFormat
format as integer order of magnitude
sourcepub fn float_oom(self) -> NumberFormat
pub fn float_oom(self) -> NumberFormat
format as float order of magnitude
sourcepub fn timestamp(self) -> NumberFormat
pub fn timestamp(self) -> NumberFormat
format as float order of magnitude
sourcepub fn format_type(self, format_type: &FormatType) -> NumberFormat
pub fn format_type(self, format_type: &FormatType) -> NumberFormat
set format type
source§impl NumberFormat
impl NumberFormat
Trait Implementations§
source§impl Clone for NumberFormat
impl Clone for NumberFormat
source§fn clone(&self) -> NumberFormat
fn clone(&self) -> NumberFormat
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more