Skip to content

Fix literal-only zero number format sections - #361

Open
developer0hye wants to merge 1 commit into
MathNya:masterfrom
developer0hye:fix/zero-format-literal
Open

Fix literal-only zero number format sections#361
developer0hye wants to merge 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.

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