Repository navigation
retain dollar sign when rounding to zero - #2997
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Negative-zero formatting and parity coverage crates/functions/src/text.rs, docs/function-parity.md |
DOLLAR retains the negative format for negative inputs that round to zero at nonnegative precision. Tests cover zero, negative zero, positive values, and negative precision. The parity worksheet records this behavior and the contrasting FIXED result. The worksheet review and update dates are 2026-10-31. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: echelon
Merge Risk: 
Minimal · up to 31740
-
The formatting change is ready to merge after the planned CI checks.
Architecture risk: 
Low · up to 11b54
-
The change affects 2 systems.
Changed systems:
crates,docsArchitecture concerns
No architecture-level concerns identified.Review details
-
Systems and components
- observed — crates (service) was modified; 1 changed file maps to changed impact.
- observed — docs (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in crates/functions/src/text.rs:
dollarnow formats a rounded zero as negative currency when precision is nonnegative and the original input is negative; negative zero and values rounded to zero at negative precision remain unsigned. - observed — Modified behavior in crates/functions/src/text.rs: Added
DOLLARexpectations for negative values rounding to zero at nonnegative precision, zero and negative-zero inputs, positive values, and negative precision, plus aFIXEDexpectation confirming its zero-sign formatting. - observed — Modified behavior in docs/function-parity.md: The review and update dates change to 2026-10-31, and the change note documents DOLLAR’s negative-zero layouts by precision, including the Windows Excel measurement details.
- observed — Modified behavior in docs/function-parity.md: A 2026-10-31 revision-history entry records DOLLAR’s behavior for negative amounts that round to zero, the unsigned treatment of exact and negative zero, and the contrasting FIXED result.
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title directly describes the main change: preserving the DOLLAR negative layout when a value rounds to zero. It is concise and specific, although it does not mention that the behavior applies to negative inputs.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Landed in main (fb1e59f). Thank you for the contribution, @Harrison-Booth! (#2996 also changed DOLLAR; the merged version keeps its 254-character limit and your sign rule.) |
Summary
Checked in a temporary unsaved workbook in Windows Excel 16.0 build 20527, LCID 1033.
DOLLAR(-0.0001,0)returned($0),DOLLAR(-0.0001,-1)returned$0, andFIXED(-0.0001,0)returned0. Exact zero and negative zero returned$0. The workbook was closed without saving.Validation
cargo fmt --check— passed.git diff --check— passed.🤖 Generated with Claude Code
Summary by CodeRabbit
DOLLARnow retain the negative currency layout when rounding to zero at nonnegative precision. Exact zero and negative zero remain unsigned, while negative precision retains the positive layout.DOLLARformatting behavior, its distinctions across precision settings, and related comparison details, including the correspondingFIXEDresult. The notes also include the review and update date.