FIX: Fix a bug were a new column style would introduce an invalid format
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
1e8441a674
commit
a10d1f4615
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user