mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-12 00:43:16 -06:00
NUMBERVALUE: a leftover dot is a decimal point, not a date separator
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user