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

Formatting double values is not always appropriate #30

Closed
fkleedorfer opened this issue Sep 16, 2024 · 1 comment · Fixed by #31
Closed

Formatting double values is not always appropriate #30

fkleedorfer opened this issue Sep 16, 2024 · 1 comment · Fixed by #31

Comments

@fkleedorfer
Copy link
Contributor

I have a use case in which high-precision double values are needed. I don't think I can define a DecimalFormat that produces these.

I have been using BigDecimal.toString() to generate the literals, and I don't want the formatter to touch these.

Also, double formatting is the only aspect in which the formatter alters the data. That actually is a big deal, I am not sure it should be enabled by default, as you cannot use automated isomorphicity checks on the result.

@atextor
Copy link
Owner

atextor commented Sep 17, 2024

Hi @fkleedorfer, I think you are absolutely correct in that the formatter must not alter data. The idea of the number formatter was to have a uniform way to write the numbers. In the first iteration of the feature, you could provide an own lambda function that would write the number as you wish (using DecimalFormat, .toString() or whatever), but you can't easily pass those as a command line option (in owl-cli), which is why I changed it.
Thinking about it, it's probably the best idea to by default print the original lexical form (the solution in your PR), so thank you, I'm all for it.

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