FIX: Fix a bug were a new column style would introduce an invalid format

This commit is contained in:
Nicolás Hatcher
2025-02-15 16:09:07 +01:00
committed by Nicolás Hatcher Andrés
parent 1e8441a674
commit a10d1f4615
4 changed files with 59 additions and 2 deletions

View File

@@ -50,8 +50,9 @@ impl Units {
fn get_units_from_format_string(num_fmt: &str) -> Option<Units> {
let mut parser = Parser::new(num_fmt);
parser.parse();
let parts = parser.parts.first()?;
// We only care about the first part (positive number)
match &parser.parts[0] {
match parts {
ParsePart::Number(part) => {
if part.percent > 0 {
Some(Units::Percentage {