Skip to content

Fix literal-only zero number format sections - #361

Merged
MathNya merged 1 commit into
MathNya:masterfrom
developer0hye:fix/zero-format-literal
Sep 3, 2026
Merged

Fix literal-only zero number format sections#361
MathNya merged 1 commit into
MathNya:masterfrom
developer0hye:fix/zero-format-literal

Conversation

@developer0hye

Copy link
Copy Markdown
Contributor

Summary

  • render selected number-format sections that contain only literals
  • support quoted text, backslash escapes, spacing markers, fill characters, and empty zero sections
  • preserve the existing date and numeric formatting paths whenever a value placeholder is present

Problem

A three-section format such as #,##0_);[Red]\(#,##0\);\-\ \ selects the third section for zero, but the formatter currently falls through to numeric formatting and returns 0 instead of the declared - literal.

Testing

  • cargo test
  • cargo clippy -- -D warnings
  • cargo +nightly fmt --all -- --check

The width-independent string formatter represents *x with one fill character; it does not expand the character to a cell width.

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye

Copy link
Copy Markdown
Contributor Author

CI note: the failing run is blocked by current baseline/toolchain drift rather than this change.

  • build (1.88.0) resolves aes 0.9.3, which now requires Rust 1.89, because the library does not commit a lockfile.
  • formatting reports current-nightly wrapping changes across existing files (date.rs, reader/driver.rs, writer/streaming_writer.rs, and others). The reported number_format.rs hunk is also an unchanged pre-existing comment.
  • The exact PR head passed cargo test, cargo clippy -- -D warnings, and cargo +nightly fmt --all -- --check locally before push; the run logs show dependency/nightly changes after that validation.

No production failure from the literal-only section implementation appears in the CI log.

@MathNya

MathNya commented Sep 3, 2026

Copy link
Copy Markdown
Owner

@developer0hye
Thank you for the PR.
Since there were no issues, I’ll go ahead and merge it.

@MathNya
MathNya merged commit 13b132e into MathNya:master Sep 3, 2026
0 of 5 checks passed
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