fix(HF-268): support consecutive percent operators - #1773
Tobiadefami wants to merge 2 commits into
Conversation
Formulas such as =5%% failed to parse even though =(5%)% worked. Consume consecutive postfix percent operators and wrap the preceding expression for each token, so =5%% returns 0.0005 and =5%%% returns 0.000005, matching Excel. Preserve each operator's whitespace and the existing operator precedence. Document the behavior in the operator guide and Unreleased changelog. Validated with the matching fix/HF-268 test branch: 502 Jest suites and 6,254 tests passed, and Chrome and Firefox each passed 6,254 tests. Compilation and performance benchmarks passed. Full lint passed with zero errors and existing warnings using the test TypeScript project.
|
@Tobiadefami thanks for the pull request. No CLA step needed here — our records show you signed the Contributor License Agreement on 2026-07-31. That signature came from our previous signing form and has been carried over, so there is nothing for you to re-sign. |
|
Task linked: HF-268 Promile operator ( |
Add the pull request reference to the consecutive percent operators changelog entry, matching the surrounding entries. Validated the PR target and checked the Markdown diff for whitespace errors.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5361c44. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1773 +/- ##
===========================================
- Coverage 97.32% 97.32% -0.01%
===========================================
Files 195 195
Lines 15739 15738 -1
Branches 3390 3460 +70
===========================================
- Hits 15318 15317 -1
+ Misses 421 413 -8
- Partials 0 8 +8
🚀 New features to boost your workflow:
|
Performance comparison of head (5361c44) vs base (c920375) |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | 56a15f1 | Commit Preview URL Branch Preview URL |
Sep 14 2026, 05:25 PM |

Formulas such as =5%% failed to parse even though =(5%)% worked. Consume consecutive postfix percent operators and wrap the preceding expression for each token, so =5%% returns 0.0005 and =5%%% returns 0.000005, matching Excel.
Preserve each operator's whitespace and the existing operator precedence. Document the behavior in the operator guide and Unreleased changelog.
Validated with the matching fix/HF-268 test branch: 502 Jest suites and 6,254 tests passed, and Chrome and Firefox each passed 6,254 tests. Compilation and performance benchmarks passed. Full lint passed with zero errors and existing warnings using the test TypeScript project.
Context
How did you test your changes?
Types of changes
Related issues:
Checklist:
Note
Low Risk
Localized parser grammar change for postfix
%with existing AST builder; behavior aligns with Excel for previously failing formulas.Overview
Fixes formula parsing so multiple postfix
%operators chain on the same atomic expression, matching Excel (e.g.=5%%→0.0005instead of failing while=(5%)%worked).The parser rule
rightUnaryOpAtomicExpressionnow consumes zero or more%tokens and appliesbuildPercentOpAstrepeatedly on the growing expression, preserving operator whitespace and precedence. Docs clarify that each%divides by 100, and the Unreleased changelog records the fix.Reviewed by Cursor Bugbot for commit 56a15f1. Bugbot is set up for automated code reviews on this repo. Configure here.