@@ -21606,17 +21606,17 @@ test(2337.5, is.null(fwrite(data.table(a=numeric()), dec=",", sep=",")))
2160621606# 2864 force decimal points for whole numbers in numeric columns
2160721607dd = data.table(x=c(1, 2, 3))
2160821608di = data.table(x=c(1L, 2L, 3L))
21609- test(2337 .1, capture.output(fwrite(dd, forceDecimal=TRUE)), c("x", "1.", "2.", "3."))
21610- test(2337 .2, capture.output(fwrite(dd, forceDecimal=TRUE, dec=",", sep="\t")), c("x", "1,", "2,", "3,"))
21611- test(2337 .3, capture.output(fwrite(dd, forceDecimal=FALSE)), c("x", "1", "2", "3"))
21612- test(2337 .4, capture.output(fwrite(di, forceDecimal=TRUE)), c("x", "1", "2", "3"))
21613- test(2337 .5, capture.output(fwrite(data.table(x=c(0.)), forceDecimal=TRUE)), c("x", "0."))
21614- test(2337 .6, capture.output(fwrite(data.table(x=c(-0.)), forceDecimal=TRUE)), c("x", "0."))
21615- test(2337 .7, capture.output(fwrite(data.table(x=c(0.00)), forceDecimal=TRUE)), c("x", "0."))
21609+ test(2338 .1, capture.output(fwrite(dd, forceDecimal=TRUE)), c("x", "1.", "2.", "3."))
21610+ test(2338 .2, capture.output(fwrite(dd, forceDecimal=TRUE, dec=",", sep="\t")), c("x", "1,", "2,", "3,"))
21611+ test(2338 .3, capture.output(fwrite(dd, forceDecimal=FALSE)), c("x", "1", "2", "3"))
21612+ test(2338 .4, capture.output(fwrite(di, forceDecimal=TRUE)), c("x", "1", "2", "3"))
21613+ test(2338 .5, capture.output(fwrite(data.table(x=c(0.)), forceDecimal=TRUE)), c("x", "0."))
21614+ test(2338 .6, capture.output(fwrite(data.table(x=c(-0.)), forceDecimal=TRUE)), c("x", "0."))
21615+ test(2338 .7, capture.output(fwrite(data.table(x=c(0.00)), forceDecimal=TRUE)), c("x", "0."))
2161621616# round trip
2161721617local({
2161821618 f <- tempfile(); on.exit(unlink(f))
21619- test(2337 .8, {fwrite(dd, f, forceDecimal=TRUE); fread(f)}, dd)
21620- test(2337 .9, {fwrite(dd, f, forceDecimal=FALSE); fread(f)}, di)
21619+ test(2338 .8, {fwrite(dd, f, forceDecimal=TRUE); fread(f)}, dd)
21620+ test(2338 .9, {fwrite(dd, f, forceDecimal=FALSE); fread(f)}, di)
2162121621})
2162221622
0 commit comments