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

Fix test with json rounding issues: #138

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

biojppm
Copy link

@biojppm biojppm commented Jun 1, 2024

This change addresses a possible confusion in a test case where JSON processors can trim trailing zero digits from the fractional part of floating numbers. It changes zeros to nonzeros in the fractional part, as a way to enforce the processors to keep the digits.

The point is not to be in the place of ambiguity where the processors could reasonably be expected to trim digits.

Another possible solution is to keep the YAML as-is, and ensure the json shows the prices as 450.00 and 2392.00; ie to change the json part to be string-equal to the yaml part, but this will stil run some risk of digit-trimming.

This change addresses a possible confusion with JSONS processors
trimming significant zero digits from the fractional part of floating
numbers. It changes zeros to nonzeros in the fractional part, as a way
to enforce the processors to keep the digits.

Another possible solution is to keep the YAML as-is, and ensure the
json shows the prices as 450.00 and 2392.00; ie to change the json
part to be string-equal to the yaml part.
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.

1 participant