New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix invalid values when receiving int2, int4, int8 via getBigDecimal() #426

Merged
merged 2 commits into from Nov 13, 2015

Conversation

Projects
None yet
2 participants
@vlsi
Member

vlsi commented Nov 13, 2015

It turns out BigDecimal.valueOf(12, 1) == "12.1" while BigDecimal.valueOf(12).setScale(1) == "12.0"

vlsi added some commits Nov 13, 2015

fix: fix invalid values when receiving int2, int4, int8 via getBigDec…
…imal()

It turns out BigDecimal.valueOf(12, 1) == "12.1" while BigDecimal.valueOf(12).setScale(1) == "12.0"

fixes #424

@vlsi vlsi force-pushed the Gordiychuk:fix_bigint branch from 93edb10 to e6f1beb Nov 13, 2015

davecramer added a commit that referenced this pull request Nov 13, 2015

Merge pull request #426 from Gordiychuk/fix_bigint
fix: fix invalid values when receiving int2, int4, int8 via getBigDecimal()

@davecramer davecramer merged commit fad7f52 into pgjdbc:master Nov 13, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@davecramer

This comment has been minimized.

Member

davecramer commented Nov 13, 2015

Thanks for the quick fix!

Dave Cramer

On 13 November 2015 at 17:15, Vladimir Sitnikov notifications@github.com
wrote:

It turns out BigDecimal.valueOf(12, 1) == "12.1" while BigDecimal.valueOf(12).setScale(1)
== "12.0"

Added new property to configure rounding mode for setScale: roundingMode

that defaults to HALF_EVEN

You can view, comment on, or merge this pull request online at:

#426
Commit Summary

  • test: add tests for getBigDecimal of int4 field in both text and
    binary modes
  • fix: fix invalid values when receiving int2, int4, int8 via
    getBigDecimal()

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#426.

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