creek
creek copied to clipboard
feat: add support for parsing general-format numbers as decimals
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_numberoption 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