[][src]Module signifix::metric

Formatter of Signifix default and alternate notation with metric prefix.

Structs

Signifix

Intermediate implementor type of this module's TryFrom and Display trait implementations. Former tries to convert a given number into this type by determining the appropriate metric prefix, the normalized significand, and the decimal mark position while latter uses this type's fields to format the number as a string of four significant figures inclusive the metric prefix symbol.

Enums

Error

An error arising from this module's TryFrom trait implementation for its Signifix type.

Constants

ALT_MAX_LEN

Number of characters in alternate notation when a sign is prefixed.

ALT_MIN_LEN

Number of characters in alternate notation when no sign is prefixed.

DEF_MAX_LEN

Number of characters in default notation when a sign is prefixed.

DEF_MIN_LEN

Number of characters in default notation when no sign is prefixed.

FACTORS

Metric prefix factors from 1E-24 to 1E-03 indexed from 0 to 7 and from 1E+03 to 1E+24 indexed from 9 to 16, or 1E+00 indexed at 8.

SYMBOLS

Metric prefix symbols from Some("y") to Some("m") indexed from 0 to 7 and from Some("k") to Some("Y") indexed from 9 to 16, or None indexed at 8.

Type Definitions

Result

The canonical Result type using this module's Error type.