purescript-contrib / purescript-formatters

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

Minus signs in wrong place with leading zeros #45

Closed dbaynard closed 5 years ago

dbaynard commented 6 years ago

Using v3.0.1

> format (Formatter { abbreviations: false, after: 0, before: 3, comma: false, sign: true }) (1.0)
"+001"
> format (Formatter { abbreviations: false, after: 0, before: 3, comma: false, sign: true }) (-1.0)
"00-1"

Using 3 leading digits is most illustrative as the effect can be seen whenever there are leading zeros.

With sign false, the result is the same for the -ve number (the positive number correctly has no sign).