Struct signifix::Signifix
[−]
[src]
pub struct Signifix { /* fields omitted */ }
Intermediate implementor type of this crate's TryFrom
and Display
trait
implementations. Former tries to convert a number to this type by
automatically choosing the metric unit prefix and appropriately adjusting
the floating point precision while latter uses this type's fields to format
the number to a string of a fixed number of significant figures and a fixed
number of resulting characters. The format parameter {}
prefixes negative
numbers with a minus sign. The variant {:+}
additionally prefixes positive
numbers with a plus sign while the variant {:#}
uses a whitespace instead
to align with negative numbers.
Methods
impl Signifix
[src]
fn prefix(&self) -> char
Automatically chosen metric unit prefix ranging from y to Y.
fn precision(&self) -> usize
Appropriately adjusted floating point precision ranging from 1 to 3.
fn significand(&self) -> f64
Metrically normalized signed significand ranging from ±1.000 to ±999.9.
Trait Implementations
impl Debug for Signifix
[src]
impl Copy for Signifix
[src]
impl Clone for Signifix
[src]
fn clone(&self) -> Signifix
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Signifix
[src]
fn eq(&self, __arg_0: &Signifix) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Signifix) -> bool
This method tests for !=
.
impl Eq for Signifix
[src]
impl<T> TryFrom<T> for Signifix where T: Into<f64>
[src]
type Err = Error
try_from
)The type returned in the event of a conversion error.
fn try_from(number: T) -> Result<Self>
try_from
)Performs the conversion.