Skip to content

fix #1798: исправлено форматирование ноля - #1799

Open
Mr-Rm wants to merge 1 commit into
EvilBeaver:developfrom
Mr-Rm:fix-1798
Open

Mr-Rm wants to merge 1 commit into
EvilBeaver:developfrom
Mr-Rm:fix-1798

Conversation

@Mr-Rm

@Mr-Rm Mr-Rm commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Если в функции Формат() указано пустое значение параметра 'ЧН=', то форматирование числа 0 или округленной до ноля дроби производится по общим для формата чисел правилам.
Дополнены тесты.

Summary by CodeRabbit

  • Bug Fixes
    • Empty zero-appearance settings no longer replace numeric formatting with "0". Zero and nonzero values now follow the configured number format, including decimal places.
  • Tests
    • Added checks for fractional and zero values when zero-appearance settings are empty.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56b73141-df7a-47e5-8d33-539e7a5d5b71
Commits

Reviewing files that changed from the base of the PR and between 40cd832 and e8cc888.

Files selected for processing: 2
  • src/OneScript.Core/Commons/ValueFormatter.cs
  • tests/formatting.os

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

FormatNumber treats an explicitly empty zero-appearance parameter as no override. Added assertions cover zero and nonzero values with empty parameters.

Changes: Number formatting

Layer / File(s) Summary
Zero-appearance handling and regression assertions
src/OneScript.Core/Commons/ValueFormatter.cs, tests/formatting.os
FormatNumber returns the configured zero appearance only when it is non-null. Tests check the resulting formatting for zero and nonzero values when ЧН and ЧВН are empty.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

Suggested reviewers: evilbeaver

Merge Risk: Minimal · up to e8cc8

The change preserves ordinary formatting when ЧН is empty. No actionable merge risk remains after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: fixing zero formatting. It is concise and directly related to the code and test changes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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. 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

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.

@Mr-Rm Mr-Rm changed the title исправлено форматирование ноля fix #1798: исправлено форматирование ноля Oct 26, 2026
@sonar-openbsl-ru-qa-bot

Copy link
Copy Markdown

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