purescript-contrib / purescript-formatters

Formatting and printing for numeric and date/time/interval values
Apache License 2.0
41 stars 29 forks source link

breakingchange: override sep.characters #86

Closed CarstenKoenig closed 1 year ago

CarstenKoenig commented 1 year ago

This is a breaking change as it changes the Data.Formatter.Number.Formatter record.

Description of the change

It adds support to have different characters for decimal- and thousand-group-separators. A use case would be formatting numbers in Germany as there these characters are flipped (1.234,56 instead of 1,234.56).

It also fixes a bug in the parsing of numbers with comma=true in the Formatter (1.12 was rejected because 1 was only a single digit not 3 - this check now only happens after the first thousand-group-separator character was parsed.


Checklist:

CarstenKoenig commented 1 year ago

This should address #85

CarstenKoenig commented 1 year ago

Hi - I hope I checked all the boxes correctly ;)

CarstenKoenig commented 1 year ago

Hi,

I think the CI did break because the package.dhall seems to misformfed/invalid - I noticed this for the PR but did not want to change the file (as I did not know if you had some other pipeline in place that needs this format)

Locally I renamed the spago.dhall, deleted the package.dhall redid spago init and then copied the old spago.dhall over - this did the trick locally (tests did pass).

If you like I'll happily add both files to the PR

garyb commented 1 year ago

No worries - I was about to fix this up and push into the branch myself, it just needs the package-set location updating to one that actually exists (seems we deleted the prepare-0.15 after 0.15 was released). Sorry about the slow back and forth on this by the way!

CarstenKoenig commented 1 year ago

I'm glad I can help out - take your time.

CarstenKoenig commented 1 year ago

Thank you :smile:

garyb commented 1 year ago

I'm hoping to get #74 included in the breaking release, so it might be another day or two before that goes in, but will definitely get it out this week. Thanks very much for the contribution!