Skip to content

Conversation

@zuckschwerdt
Copy link

This fixes the sign and padding problems in string format for negative Numerics.

  • The decimal part must not be negative when formatting to string, change to use .abs().
  • The integer part must have a "signed zero" when the value is negative, change to use .abs() and explicit sign.

I.e. before / after

  • Numeric(-123, 1) was "-12.-3" now is "-12.3"
  • Numeric(-123, 2) was "-1.-23" now is "-1.23"
  • Numeric(-123, 3) was "0.-123" now is "-0.123"
  • Numeric(-123, 4) was "0.-123" now is "-0.0123"

Fixes #368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Negative Numeric Floats sign issue

1 participant