Skip to content

Commit

Permalink
fix: avoid double precision in getBigDecimal
Browse files Browse the repository at this point in the history
This fixes issue xerial#1002.
  • Loading branch information
InitFlo committed Oct 29, 2023
1 parent 4dba62c commit 44fb4af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/sqlite/jdbc3/JDBC3ResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ public BigDecimal getBigDecimal(int col) throws SQLException {
switch (safeGetColumnType(checkCol(col))) {
case SQLITE_NULL:
return null;
case SQLITE_FLOAT:
return BigDecimal.valueOf(safeGetDoubleCol(col));
case SQLITE_INTEGER:
return BigDecimal.valueOf(safeGetLongCol(col));
case SQLITE_FLOAT:
//avoid double precision
default:
final String stringValue = safeGetColumnText(col);
try {
Expand Down

0 comments on commit 44fb4af

Please sign in to comment.