Skip to content

fix: read decimals written in exponential notation - #52

Merged
vaceslav merged 1 commit into
mainfrom
fix/exponent
Sep 28, 2026
Merged

vaceslav merged 1 commit into
mainfrom
fix/exponent

Conversation

@vaceslav

Copy link
Copy Markdown
Contributor

Closes #44.

The profiler and the extractor now parse a decimal written as text with a single shared set of styles, NumberReading.DecimalStyles = NumberStyles.Number | NumberStyles.AllowExponent. Because both use it, a column that is proposed as decimal also imports as decimal. Float was not used, because it drops thousands separators and 1,234.56 would stop reading.

  • Under a culture whose decimal separator is ., -6.9345e-03 reads as -0.0069345.
  • de-DE: 1,5e-3 reads as 0.0015. 1.5e-3 is neither a decimal there nor a well-formed grouped number, so it is an outlier.
  • Integers: a value written in exponential notation counts as a decimal only, even when it is whole (1E+5). It is a measurement, and a column of such values should not be proposed as a column of counts. Integer parsing is unchanged, so the profile and an import into an integer field agree on this.

Tests (ExponentNotationTests) cover the profile and the import, from csv and from xlsx text cells. They also pin that grouped numbers still read. Six of the seven failed before the change; the grouped-number test pins behaviour that was already right and has to stay right. The KNOWN-ISSUES entry is removed.

@vaceslav
vaceslav merged commit b174704 into main Sep 28, 2026
9 checks passed
@vaceslav
vaceslav deleted the fix/exponent branch September 28, 2026 15:43
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.

Numbers in scientific notation are profiled and read as text

1 participant