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

Float serialization: option to limit precision #189

Open
madig opened this issue Sep 30, 2021 · 7 comments
Open

Float serialization: option to limit precision #189

madig opened this issue Sep 30, 2021 · 7 comments

Comments

@madig
Copy link
Collaborator

madig commented Sep 30, 2021

ufonormalizer by default truncates floats to 10 decimal places, leading to diffs between norad and ufonormalizer on e.g. guideline angles.

@chrissimpkins
Copy link
Collaborator

+1 to anything that limits unnecessary / uninformative diffs

@madig
Copy link
Collaborator Author

madig commented Sep 30, 2021

I found an annoying behavior in ufonormalizer: if you try to work around the truncation and give e.g. 20 decimal places, it also changes color strings from <string>0.6,1,0.604,1</string> into <string>0.5999999999999999778,1,0.60399999999999998135,1</string>. Argh.

@chrissimpkins
Copy link
Collaborator

Lol. For those times when you need the exact color that you want.

Do you need to dig into serde to address this here?

@madig
Copy link
Collaborator Author

madig commented Sep 30, 2021

Hm, I'm not sure yet. For glif serialization, a simple function might work; for serde serialization, I think you can direct it to use a custom function.

@chrissimpkins
Copy link
Collaborator

chrissimpkins commented Nov 15, 2021

+1 to anything that limits unnecessary / uninformative diffs

I came across this with another serializer today... (╯°□°)╯︵ ┻━┻

2021-11-15_14-35-52

@madig
Copy link
Collaborator Author

madig commented Nov 15, 2021

Ugh. Which one?

@chrissimpkins
Copy link
Collaborator

chrissimpkins commented Nov 15, 2021

Ugh. Which one?

Emailed details to you. I didn't make the edits. I think that this is ufolib2?

@madig madig mentioned this issue Mar 9, 2022
22 tasks
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

No branches or pull requests

2 participants