Skip to content
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

Decimal values in scientific notation #1191

Merged
merged 2 commits into from
Apr 11, 2021
Merged

Conversation

KACAH
Copy link

@KACAH KACAH commented Feb 25, 2021

Hi!

XML Schema Definition (XSD) does not support scientific notation (1.1234e-3) in xsd:decimal by standart. Some resources doesn't mention scientific notation at all. Some mention the restriction directly.

The decimal separator is always a point (.), and no separation at the thousand mark may be added. There is no support for scientific notation.

Right now str(value) in Decimal builtin type makes the xml value without beeing aware of this restriction. Here is a small fix and couple of tests for this case. The fix uses Python format {:f} method which converts value to Fixed Point string.

@mvantellingen mvantellingen merged commit 83eefa2 into mvantellingen:master Apr 11, 2021
@mvantellingen
Copy link
Owner

Thanks!

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