Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fabianskier
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

decimal records are not processed correctly
1 participant