Skip to content

Commit

Permalink
Missing parentheses for NA timestamps
Browse files Browse the repository at this point in the history
Fixes #63
  • Loading branch information
jeroen committed Oct 24, 2022
1 parent e8b412d commit 876b74d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/write_xlsx.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ SEXP C_write_data_frame_list(SEXP df_list, SEXP file, SEXP col_names, SEXP forma
}; continue;
case COL_POSIXCT: {
double val = REAL(col)[i];
if(R_FINITE(val))
if(R_FINITE(val)){
val = 25568.0 + val / (24*60*60);
if(val >= 60.0)
val = val + 1.0;
assert_lxw(worksheet_write_number(sheet, cursor, j, val , NULL));
}
}; continue;
case COL_STRING:{
SEXP val = STRING_ELT(col, i);
Expand Down

0 comments on commit 876b74d

Please sign in to comment.