Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add support for parsing general-format numbers as decimals#133

Open
fabianskier wants to merge 1 commit intopythonicrubyist:master from
fabianskier:fix-decimal-value-formatting
Open

feat: add support for parsing general-format numbers as decimals #133
fabianskier wants to merge 1 commit intopythonicrubyist:master from
fabianskier:fix-decimal-value-formatting

Conversation

@fabianskier
Copy link

@fabianskier fabianskier commented Jun 17, 2025

Summary

Add support for automatic parsing of Excel cells with General number format into numeric values (e.g., "1E-3" becomes 0.001). This is controlled via the new parse_general_as_number option in Creek::Book.

Key changes

  • Introduced parse_general_as_number option to Creek::Book and Sheet.
  • Updated the value converter to detect and convert numeric strings in exponential or decimal form using BigDecimal.
  • Preserved backward compatibility: parsing only occurs if the flag is explicitly enabled.
  • Added test coverage with sample files containing large numbers and scientific notation.

Motivation

Without this change, numeric values formatted as General are returned as raw strings, which can lead to incorrect parsing or extra manual conversion. This feature improves developer ergonomics and data consistency.

Related issue

Fixes #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

decimal records are not processed correctly

1 participant

AltStyle によって変換されたページ (->オリジナル) /