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

Flatten(): render even large numbers as-is, not using scientific notation #657

Merged
merged 5 commits into from Mar 25, 2024

Conversation

Al2Klimov
Copy link
Member

@Al2Klimov Al2Klimov commented Oct 10, 2023

E.g. 2000000000000000000 (explicitly), not 2e+18 (as with fmt.Sprintf("%v")).

fixes #659

TODO

@Al2Klimov Al2Klimov added bug Something isn't working area/configsync labels Oct 10, 2023
@cla-bot cla-bot bot added the cla/signed label Oct 10, 2023
@julianbrost julianbrost added this to the 1.1.2 milestone Mar 8, 2024
pkg/flatten/flatten.go Outdated Show resolved Hide resolved
@julianbrost
Copy link
Contributor

Anyway, the tests don't have to wait for the implementation details. Part of the tests should be to verify that the implementation isn't changed in other ways, so please add them as a first commit so that they pass on the old implementation and then add another case for large floats with the updated implementation.

Copy link
Contributor

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reorder the commits so that that the tests are added first without the 1e23 case, so that when the tests are run on this commit, it shows that the old implementation conforms to the tests, and then fixing the implementation including an additional test case, showing that the new implementation passes the same tests as the old one plus a new one.

pkg/flatten/flatten_test.go Outdated Show resolved Hide resolved
pkg/types/string.go Outdated Show resolved Hide resolved
@julianbrost julianbrost merged commit 2c46830 into main Mar 25, 2024
31 checks passed
@julianbrost julianbrost deleted the Flatten-no-exponent branch March 25, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not convert/calculate on custom variable content
2 participants