pub fn fmt_align_fractions(
    fractions: &[FractionNumber],
    precision: FormatPrecision
) -> Vec<String>
Expand description

Convenient wrapper around fmt_align_fraction_strings that takes a slice of floating point values, formats them all with a maximum precision and returns a list of aligned, formatted strings.

Examples found in repository?
examples/example.rs (line 20)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
fn main() {
    let input_1 = vec!["-42", "0.3214", "1000", "-1000.2", "2.00000"];
    let aligned_1 = fmt_align_fraction_strings(&input_1);
    println!("{:#?}", aligned_1);

    // or

    let input_2 = vec![
        FractionNumber::F32(-42.0),
        FractionNumber::F64(0.3214),
        FractionNumber::F64(1000.0),
        FractionNumber::F64(-1000.2),
        FractionNumber::F64(2.00000),
    ];
    let max_precision = 4;
    let aligned_2 = fmt_align_fractions(&input_2, FormatPrecision::Max(max_precision));
    println!("{:#?}", aligned_2);
}