Skip to content

quickfix ticks - don't round to zero in log scaled range#4496

Merged
lsabor merged 1 commit intomainfrom
quickfix/ticks
Mar 16, 2026
Merged

quickfix ticks - don't round to zero in log scaled range#4496
lsabor merged 1 commit intomainfrom
quickfix/ticks

Conversation

@lsabor
Copy link
Contributor

@lsabor lsabor commented Mar 16, 2026

don't try to round to zero if there is a zero point b/c it would be outside of the range

Summary by CodeRabbit

Bug Fixes

  • Fixed an issue with number formatting where zero-value approximations were incorrectly applied in certain edge cases. The formatter now properly respects custom zero-point configurations, ensuring accurate number display across different formatting scenarios. This prevents unintended zero-approximation behavior when specific zero points are defined.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fc03acfd-5708-4801-b486-65c99a173686

📥 Commits

Reviewing files that changed from the base of the PR and between 31f82db and 48449a6.

📒 Files selected for processing (1)
  • front_end/src/utils/formatters/number.ts

📝 Walkthrough

Walkthrough

The abbreviatedNumber function in the number formatter utility has been modified to add an additional gating condition for the zero-reduction logic. It now only applies this fast-path when scaling.zero_point is nil, ensuring values near zero are not automatically abbreviated when an explicit zero point is defined in the scaling configuration.

Changes

Cohort / File(s) Summary
Zero-Point Gating Logic
front_end/src/utils/formatters/number.ts
Added condition to prevent zero-fast-path activation when scaling.zero_point is present, requiring both range_min and range_max to be defined AND zero_point to be nil before applying zero-reduction logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ncarazon

Poem

🐰 A zero point's a tricky thing,
When scaling spreads its wings,
Now we check before we abbreviate,
Preventing zeros to their fate! ✨

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'quickfix ticks - don't round to zero in log scaled range' directly describes the main change: preventing zero-rounding behavior in log-scaled ranges with zero points.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch quickfix/ticks
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

Cleanup: Preview Environment Removed

The preview environment for this PR has been destroyed.

Resource Status
🌐 Preview App Deleted
🗄️ PostgreSQL Branch Deleted
⚡ Redis Database Deleted
🔧 GitHub Deployments Removed
📦 Docker Image Retained (auto-cleanup via GHCR policies)

Cleanup triggered by PR close at 2026-03-16T18:52:59Z

@lsabor lsabor merged commit 8c53a55 into main Mar 16, 2026
14 checks passed
@lsabor lsabor deleted the quickfix/ticks branch March 16, 2026 18:53
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.

1 participant