pub enum Sign {
Positive,
Negative,
}Expand description
Specifies how signs should be displayed for numeric values.
The Sign enum controls the display of signs for numeric values in formatted output.
It determines whether positive numbers should show a plus sign, only negative numbers
should show a minus sign, or no special sign handling should be applied.
§Format Specification
In format strings, these correspond to:
+forSign::Positive(show signs for both positive and negative numbers)-forSign::Negative(show signs only for negative numbers, default behavior)
Variants§
Positive
Always show the sign for numeric values.
Positive numbers will be prefixed with +, and negative numbers with -.
This corresponds to the + format specifier.
Negative
Only show the sign for negative numbers.
Negative numbers will be prefixed with -, while positive numbers will
have no sign prefix. This is the default behavior and corresponds to
the - format specifier.
Trait Implementations§
impl Copy for Sign
Auto Trait Implementations§
impl Freeze for Sign
impl RefUnwindSafe for Sign
impl Send for Sign
impl Sync for Sign
impl Unpin for Sign
impl UnwindSafe for Sign
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more