Skip to content

Preserve decimal values when expanding scientific notation - #84

Merged
xrotwang merged 1 commit into
cldf:masterfrom
Rajvira10:fix/decimal-exponent-formatting
Oct 17, 2026
Merged

xrotwang merged 1 commit into
cldf:masterfrom
Rajvira10:fix/decimal-exponent-formatting

Conversation

@Rajvira10

Copy link
Copy Markdown
Contributor

Serializing decimal values from scientific notation can change their magnitude or lose the minus sign. Use Decimal's fixed-point formatting instead of manually moving digits, preserving values written to CSV.

Eleven new regression cases fail before the fix; 824 tests pass afterward, with 16 expected failures and one live-network test excluded. Production Flake8 passes; the test file's five existing findings are unchanged. Other Python versions were not run locally.

@Rajvira10
Rajvira10 marked this pull request as ready for review October 16, 2026 20:05
@xrotwang

Copy link
Copy Markdown
Contributor

Thanks! I'm happy to see this embarrassing bit of code being deleted t.formatted('1e6') == '100000.0' :)

@xrotwang
xrotwang merged commit 8f80a7b into cldf:master Oct 17, 2026
5 checks passed
@xrotwang

Copy link
Copy Markdown
Contributor

Fix released with https://pypi.org/project/csvw/4.1.1/

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.

2 participants