Skip to content

Commit f855e59

Browse files
authored
Issue 51160: update jsonEncodeRowsAndParams() to better handle decimal values for toJSON() (#109)
Rlabkey v3.4.0
1 parent 52e4357 commit f855e59

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

Rlabkey/DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: Rlabkey
2-
Version: 3.3.0
3-
Date: 2024-08-08
2+
Version: 3.4.0
3+
Date: 2024-10-22
44
Title: Data Exchange Between R and 'LabKey' Server
55
Authors@R: c(person(given = "Peter",
66
family = "Hussey",

Rlabkey/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Changes in 3.4.0
2+
o Issue 51160: update jsonEncodeRowsAndParams() to better handle decimal values for toJSON()
3+
14
Changes in 3.3.0
25
o Add labkey.experiment.lineage API to support getting parent/child relationships for exp objects by LSID
36

Rlabkey/R/makeDF.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ convertFactorsToStrings <- function(df)
237237
jsonEncodeRowsAndParams <- function(rows, params, na=NULL)
238238
{
239239
nrows <- nrow(rows)
240-
p1 <- toJSON(params, auto_unbox=TRUE)
240+
p1 <- toJSON(params, auto_unbox=TRUE, digits = NA) # digits = NA to avoid trimming values (Issue 51160)
241241
cnames <- colnames(rows)
242242
p3 <- NULL
243243
for(j in 1:nrows)
@@ -247,7 +247,7 @@ jsonEncodeRowsAndParams <- function(rows, params, na=NULL)
247247
if (!is.null(na)) {
248248
cvalues[is.na(cvalues)] = na
249249
}
250-
p2 <- toJSON(cvalues, auto_unbox=TRUE)
250+
p2 <- toJSON(cvalues, auto_unbox=TRUE, digits = NA) # digits = NA to avoid trimming values (Issue 51160)
251251
p3 <- c(p3, p2)
252252
}
253253
p3 <- paste(p3, collapse=",")

Rlabkey/man/Rlabkey-package.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ schema objects (\code{labkey.getSchema}).
1818
\tabular{ll}{
1919
Package: \tab Rlabkey\cr
2020
Type: \tab Package\cr
21-
Version: \tab 3.3.0\cr
22-
Date: \tab 2024-08-08\cr
21+
Version: \tab 3.4.0\cr
22+
Date: \tab 2024-10-22\cr
2323
License: \tab Apache License 2.0\cr
2424
LazyLoad: \tab yes\cr
2525
}

0 commit comments

Comments
 (0)