Skip to content

fix(HF-162): scale TEXT percentage formats before rounding - #1776

Open
Tobiadefami wants to merge 2 commits into
developfrom
fix/HF-162
Open

Tobiadefami wants to merge 2 commits into
developfrom
fix/HF-162

Conversation

@Tobiadefami

@Tobiadefami Tobiadefami commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Context

How did you test your changes?

Types of changes

  • Breaking change (a fix or a feature because of which an existing functionality doesn't work as expected anymore)
  • New feature or improvement (a non-breaking change that adds functionality)
  • Bug fix (a non-breaking change that fixes an issue)
  • Additional language file, or a change to an existing language file (translations)
  • Change to the documentation

Related issues:

  1. Fixes #...

Checklist:

  • I have reviewed the guidelines about Contributing to HyperFormula and I confirm that my code follows the code style of this project.
  • I have signed the Contributor License Agreement.
  • My change is compliant with the OpenDocument standard.
  • My change is compatible with Microsoft Excel.
  • My change is compatible with Google Sheets.
  • I described my changes in the CHANGELOG.md file.
  • My changes require a documentation update.
  • My changes require a migration guide.

Note

Medium Risk
Changes default TEXT output for % formats (behavior fix aligned with Excel), which may affect spreadsheets that relied on the old scaling or manual *100 workarounds.

Overview
Fixes TEXT percentage number formats so they match Excel: each active % in the format string multiplies the numeric value by 100 before rounding, so TEXT(0.0123,"0.00%") returns 1.23% instead of 0.01%.

The number-format parser now tokenizes %, quoted literals, and escapes separately (quoted or escaped % stay literal and do not scale). numberFormat applies scaling once per percent token, surfaces #VALUE! if scaling overflows, and appends % in the output. CHANGELOG and the Excel compatibility guide document the behavior and note that workarounds that manually multiply by 100 can be removed.

Reviewed by Cursor Bugbot for commit 0a2fb42. Bugbot is set up for automated code reviews on this repo. Configure here.

@cla-external-contractor-signup

Copy link
Copy Markdown

@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.

@qunabu

qunabu commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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 eb63d50. Configure here.

Comment thread CHANGELOG.md Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 17, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hyperformula-docs 0a2fb42 Commit Preview URL

Branch Preview URL
Sep 17 2026, 10:11 PM

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

Performance comparison of head (0a2fb42) vs base (c920375)

                                     testName |   base |    head | change
-------------------------------------------------------------------------
                                      Sheet A | 482.34 |  488.46 | +1.27%
                                      Sheet B | 152.44 |  152.68 | +0.16%
                                      Sheet T | 135.22 |  135.67 | +0.33%
                                Column ranges | 467.12 |  463.18 | -0.84%
                                Sorted lookup |  14585 | 13705.9 | -6.03%
Sheet A:  change value, add/remove row/column |  14.65 |      14 | -4.44%
 Sheet B: change value, add/remove row/column | 129.07 |  132.22 | +2.44%
                   Column ranges - add column | 147.94 |  142.81 | -3.47%
                Column ranges - without batch | 447.41 |  437.34 | -2.25%
                        Column ranges - batch |  114.4 |  108.21 | -5.41%

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.32%. Comparing base (c920375) to head (0a2fb42).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1776   +/-   ##
========================================
  Coverage    97.32%   97.32%           
========================================
  Files          195      195           
  Lines        15739    15758   +19     
  Branches      3390     3468   +78     
========================================
+ Hits         15318    15337   +19     
+ Misses         421      413    -8     
- Partials         0        8    +8     
Files with missing lines Coverage Δ
src/format/format.ts 99.37% <100.00%> (+0.02%) ⬆️
src/format/parser.ts 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants