Skip to content

Fix cannot enter small decimals in breakpoint table #42

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

Merged
merged 7 commits into from
Mar 21, 2025

Conversation

xispa
Copy link
Member

@xispa xispa commented Mar 21, 2025

Description of the issue/feature this PR addresses

This Pull Request patches z3c.form.converter.NumberDataConverter to prevent the error "The entered value is not a valid decimal literal" that arises when entering small decimal values like 0.0625 into breakpoint table:

283253597-cffdc166-66c6-4720-b67c-9c46dc6abb38

Another (and maybe better) approach could be any of these:

  • Replace all schema.Float and use schema.TextLine (with their counterpart validators)
  • Add an IDataConverter adapter for schema.Float to take these cases into account (preferred).

See plone.schema.browser.jsonfield for hints.

Current behavior before PR

Is not possible to enter small decimals in breakpoint table.

Desired behavior after PR is merged

Is possible to enter small decimals in breakpoint table.

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@xispa xispa requested a review from ramonski March 21, 2025 08:47
@xispa xispa added the bug Something isn't working label Mar 21, 2025
@ramonski ramonski merged commit 194b9c5 into master Mar 21, 2025
2 checks passed
@ramonski ramonski deleted the fix-smaller-decimals branch March 21, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants