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

"-0" is not preserved in original file #66

Closed
rafzi opened this issue Nov 14, 2023 · 2 comments · Fixed by #70
Closed

"-0" is not preserved in original file #66

rafzi opened this issue Nov 14, 2023 · 2 comments · Fixed by #70

Comments

@rafzi
Copy link

rafzi commented Nov 14, 2023

This is probably because it is parsed as int by unityparser, while unity probably parses it as float, where the "-0.0" can be preserved.

Happy to open a PR, but not sure where to start.

@sp-ricard-valverde
Copy link
Collaborator

I'm getting to the conclusion that we need to treat every float and int value as str to preserve all uniqueness in Unity formatting the documents as it seems impossible to track every use case.

When the library was released we tried to be clever about parsing some numeric values so they were available to manipulate in Python but I think the safest approach would be to let the user's Python code convert a given str value to a Python type before manipulation if required. If numeric values are not manipulated in any way they will be dumped back in the same exact str format the were serialized.

@rafzi
Copy link
Author

rafzi commented Nov 15, 2023

Not sure if the following is related, so i create a new issue: #67

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 a pull request may close this issue.

2 participants