NUMBERVALUE: a leftover dot is a decimal point, not a date separator

This commit is contained in:
Harrison Booth
2026-10-26 11:39:22 -05:00
parent a75b19e678
commit 5ed5c09bc6
+4
View File
@@ -338,6 +338,10 @@ fn numbervalue(a: &[Arg], c: &mut dyn Ctx) -> R<Value> {
out.push(c);
}
}
// A leftover `.` can be a decimal point but never a date separator: `1.2.3` is `#VALUE!` in Excel.
if out.matches('.').count() > 1 {
return Err(CellError::Value);
}
let mut n = parse_number_text_in(&out, c.date_system()).ok_or(CellError::Value)?;
for _ in 0..pct {
n /= 100.0;