Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, thanks for creating this lib :)
I've been working with
Decimal
mostly becausefloat
uses the shortest representation according to the algorithm described in "Printing Floating-Point Numbers Quickly and Accurately" (quoting the doc https://hexdocs.pm/elixir/Float.html#to_string/1), ie:Besides this presentation issue, converting
to_string
makes that cell to be a binary which isn't ideal for working with formulas on the sheet.AFAIK this has been proposed before (#43) but it was rejected for 2 reasons: 1) no actual use-case for it, and 2) for adding the
Decimal
lib (looks like that's the main reason). Turns out there's no need to actually add a dependency, we can check if it's loaded at run-time, just like many libs do, eg in ecto_sql or phoenix_live_view. I believe that's reasonable so I'd like to propose addingDecimal
handling yet one more time, considering there's a real use-case to justify adding it and there's no need to add a dependency./edit On repo https://github.com/leandrocp/elixlsx_decimal/commits/main you can see an example with and without Decimal