[][src]Function fraction_list_fmt_align::fmt_align_fraction_strings

pub fn fmt_align_fraction_strings(strings: &[&str]) -> Vec<String>

Aligns a number of formatted fraction numbers. Valid strings are for example 1, 3.14, and -42. Aligns all with additional padding on the left so that all of them can be printed line by line in an aligned way. This means that in every line the tens digits will be aligned, the once places will be aligned, the decimal place will be aligned etc. (TODO are these the proper english terms?)

This takes the precision from the longest fractional part (without unnecessary zeroes) to align all strings.

Example Input

"-42"
"0.3214"
"1000"
"-1000.2"
"2.00000"

Example Output

"  -42     "
"    0.3214"
" 1000     "
"-1000.2   "
"    2     "