basvandijk / scientific

Arbitrary-precision floating-point numbers represented using scientific notation
BSD 3-Clause "New" or "Revised" License
73 stars 40 forks source link

extended Scientific to include the displayMode for use with show #26

Closed trilogysci closed 9 years ago

trilogysci commented 9 years ago

Allow changing of Show method. in support of: https://github.com/bos/aeson/issues/227#issuecomment-63042291 Supports 4 modes in increasing order

Binary operations with two Scientific values will promote the displayMode to the "highest" of the two.

New Scientific values will be created with ScDisplayGeneric, if not otherwise specified. scientific works the same using ScDisplayGeneric. scientificDisp allows specifying displayMode as well as other scientific values.

basvandijk commented 9 years ago

Thanks for the patch!

I will try to review it this evening.

In the mean time, could you also adjust the scientificBuilder in both Data.Text.Lazy.Builder.Scientific and Data.ByteString.Builder.Scientific so that they take the display-mode into account?

basvandijk commented 9 years ago

Hi @trilogysci, did you get around implementing your changes in Data.Text.Lazy.Builder.Scientific and Data.ByteString.Builder.Scientific?

trilogysci commented 9 years ago

Yes it was in my last commit. https://github.com/trilogysci/scientific/commit/8b8a76fa29326c9807ab7588574890b053804322

On 03/17/2015 10:10 AM, Bas van Dijk wrote:

Hi @trilogysci https://github.com/trilogysci, did you get around implementing your changes in |Data.Text.Lazy.Builder.Scientific| and |Data.ByteString.Builder.Scientific|?

— Reply to this email directly or view it on GitHub https://github.com/basvandijk/scientific/pull/26#issuecomment-82372646.

basvandijk commented 9 years ago

Oops I completely missed that. I will look at it this evening. Thanks!

basvandijk commented 9 years ago

I finally merged it. I will probably release it in the coming days.