pub fn parse_format_spec(s: &str) -> Result<FormatSpec, String>Expand description
Parse an Excel-style hash-pattern format string.
Accepted shapes (# and 0 interchangeable):
"#"/"0"— round to integer, no decimal portion."#.##"/"0.00"— round to 2 decimal places."##.###"/"00.000"— round to 3 decimal places."#."— equivalent to"#"(trailing.allowed, zero decimal places).
Rejects:
- Empty strings.
- Printf-style (
%3.2f). - Multiple
.s. - Non-
#/0characters (no,, no%, noe).
Returns the compiled FormatSpec.