From c895acf1f7a16f403721ba3e05fabd6b54f741ed Mon Sep 17 00:00:00 2001 From: Harrison Booth <73434116+Harrison-Booth@users.noreply.github.com> Date: Fri, 30 Oct 2026 19:22:39 -0500 Subject: [PATCH 1/2] Fix base conversion whitespace validation --- crates/functions/src/engineering.rs | 17 ++++++++++++++++- docs/function-parity.md | 4 +++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/crates/functions/src/engineering.rs b/crates/functions/src/engineering.rs index ed2572f90..8143c0146 100644 --- a/crates/functions/src/engineering.rs +++ b/crates/functions/src/engineering.rs @@ -25,7 +25,7 @@ fn base_source(a: &[Arg]) -> R { Ok(number_to_text(n)) } Value::Empty => Ok(String::new()), - v => Ok(v.to_text()?.trim().to_string()), + v => Ok(v.to_text()?.to_string()), } } @@ -411,6 +411,21 @@ mod tests { is_text(ev("OCT2HEX", vec![n(100.0), n(4.0)]), "0040"); is_text(ev("OCT2HEX", vec![n(7777777533.0)]), "FFFFFFFF5B"); is_err(ev("BIN2DEC", vec![n(102.0)]), CellError::Num); + for (f, input) in [ + ("BIN2DEC", " 10"), + ("BIN2DEC", "10 "), + ("BIN2DEC", "\t10"), + ("BIN2HEX", " 10"), + ("BIN2OCT", "10 "), + ("HEX2DEC", " 10"), + ("HEX2BIN", "10 "), + ("HEX2OCT", "\t10"), + ("OCT2DEC", " 10"), + ("OCT2BIN", "10 "), + ("OCT2HEX", "\t10"), + ] { + is_err(ev(f, vec![t(input)]), CellError::Num); + } is_err(ev("HEX2DEC", vec![t("GG")]), CellError::Num); is_err(ev("BIN2DEC", vec![t("11111111111")]), CellError::Num); is_err(ev("DEC2BIN", vec![t("abc")]), CellError::Value); diff --git a/docs/function-parity.md b/docs/function-parity.md index bf57fcd3e..12b8eb790 100644 --- a/docs/function-parity.md +++ b/docs/function-parity.md @@ -1,6 +1,6 @@ # Function parity: worksheet functions and formulas -> **Last reviewed:** 2026-10-15 · **Last updated:** 2026-10-25 · **Change:** minor (the LAMBDA row lists the recursion limit and its `#NUM!`, and the error a defined name holding an error gives when called; earlier: number text with accounting parentheses coerces like Excel 365; INDEX with one index on a 2-D reference is #REF! as in Excel; earlier: SUBTOTAL and AGGREGATE cap the cells they visit, #2175) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 +> **Last reviewed:** 2026-10-31 · **Last updated:** 2026-10-31 · **Change:** minor (base conversion rejects surrounding whitespace in source strings, as observed in Excel) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 Excel's worksheet functions, category by category, against GridCraft's function library. Part of [target-app-parity.md](target-app-parity.md); gaps feed [gaps.md](gaps.md). @@ -29,6 +29,8 @@ Excel's worksheet functions, category by category, against GridCraft's function ## Coverage +| 2026-10-31 | minor | BIN2*, HEX2* and OCT2* reject surrounding spaces and tabs in source strings with `#NUM!`, matching Excel; plain unpadded values remain valid | + **Measured: 513 / 523 by name (98.1%); 504 / 523 working (96.4%).** | Category | Excel | Ours | Working | % working | Missing | From 9e710199b1e613c847b5da8a2cae4cc3c46c7c3c Mon Sep 17 00:00:00 2001 From: Harrison Booth <73434116+Harrison-Booth@users.noreply.github.com> Date: Fri, 30 Oct 2026 19:36:06 -0500 Subject: [PATCH 2/2] Move base source parity note to history --- docs/function-parity.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/function-parity.md b/docs/function-parity.md index 25571dabf..8fbfe52a5 100644 --- a/docs/function-parity.md +++ b/docs/function-parity.md @@ -29,8 +29,6 @@ Excel's worksheet functions, category by category, against GridCraft's function ## Coverage -| 2026-10-31 | minor | BIN2*, HEX2* and OCT2* reject surrounding spaces and tabs in source strings with `#NUM!`, matching Excel; plain unpadded values remain valid | - **Measured: 513 / 523 by name (98.1%); 504 / 523 working (96.4%).** | Category | Excel | Ours | Working | % working | Missing | @@ -126,6 +124,7 @@ workbooks; results checked in as data, not Excel files) and fixing what it finds | Date | Change | Summary | |---|---|---| +| 2026-10-31 | minor | BIN2*, HEX2* and OCT2* reject surrounding spaces and tabs in source strings with `#NUM!`, matching Excel; plain unpadded values remain valid | | 2026-10-27 | minor | ECMA.CEILING added to the functions that are in our library but not on Microsoft's list (with USDOLLAR), so the counts don't change | | 2026-10-26 | minor | IMSQRT uses Excel's polar route with its cosine reduction, so `IMSQRT("-4")` is `1.22514845490862E-16+2i` as in Excel (exact `2i` before); the rows list the IM* differences still open | | 2026-10-25 | minor | LAMBDA row: a LAMBDA that calls itself more than 140 times, and a formula nested past the depth limit, give `#NUM!` (#1809; nesting gave `#CALC!` before). `=Foo(1)` where the defined name Foo holds `#N/A` gives `#N/A`, not `#NAME?` |