Closed doughsay closed 1 year ago
I published ex_cldr_units version 3.16.2 with the following changelog entry:
Cldr.round/1
for float units. Thanks to @doughsay for the report. Closes #38.Thanks much for the report and the PR, really appreciated.
BTW, I would probably change the order of the functions to maximise the precision:
iex> Cldr.Unit.new!(:meter, "12.34") |> Cldr.Unit.round(1) |> Cldr.Unit.to_float_unit()
I think delaying the call to Cldr.Unit.to_float_unit()
to as late as possible is optimal (but not essential in this case).
Thanks so much for the quick turnaround! And thanks for the suggestion, will definitely keep it in mind. Really I'd like to stop using floats altogether, but that's going to require a bigger refactor 😅
When upgrading from 3.15.0 to 3.16.1, this code started to fail when it previously didn't: