Skip to content

Commit

Permalink
fix: dbQuoteLiteral() uses exponential notation for numeric values
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Apr 1, 2024
1 parent a23c544 commit 3422ef1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/dbQuoteLiteral_DBIConnection.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ dbQuoteLiteral_DBIConnection <- function(conn, x, ...) {
return(SQL(blob_data, names = names(x)))
}

if (is.double(x)) {
out <- sprintf("%.17e", x)
out[is.na(x)] <- "NULL"
return(SQL(x, names = names(x)))
}

if (is.logical(x)) {
x <- as.numeric(x)
x <- as.integer(x)
}

x <- as.character(x)
Expand Down

0 comments on commit 3422ef1

Please sign in to comment.