Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/sas/readstat_xport_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ static readstat_error_t xport_construct_format(char *dst, size_t dst_len,
}
if (decimals) {
pos += snprintf(pos, dst_len-(pos-dst), ".%d", decimals);
} else if (width) {
pos += snprintf(pos, dst_len-(pos-dst), ".");
}

free(format);
Expand Down
8 changes: 4 additions & 4 deletions src/test/test_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -1479,15 +1479,15 @@ static rt_test_group_t _test_groups[] = {
.test_formats = RT_FORMAT_SAS,
.columns = {
{ .name = "VAR1", .type = READSTAT_TYPE_DOUBLE, .format = "10.3", .label_set = "10.3" },
{ .name = "VAR2", .type = READSTAT_TYPE_STRING, .format = "$CHAR3", .label_set = "$CHAR3" }
{ .name = "VAR2", .type = READSTAT_TYPE_STRING, .format = "$CHAR3.", .label_set = "$CHAR3." }
}
},
{
.label = "SAS informats",
.test_formats = RT_FORMAT_SAS7BDAT | RT_FORMAT_XPORT_8,
.columns = {
{ .name = "VAR1", .type = READSTAT_TYPE_DOUBLE, .informat = "10.3" },
{ .name = "VAR2", .type = READSTAT_TYPE_STRING, .informat = "$CHAR3" }
{ .name = "VAR2", .type = READSTAT_TYPE_STRING, .informat = "$CHAR3." }
}
},
{
Expand All @@ -1503,9 +1503,9 @@ static rt_test_group_t _test_groups[] = {
.columns = {
{ .name = "VAR1", .type = READSTAT_TYPE_DOUBLE, .format = "10.3", .label_set = "10.3" },
{ .name = "VAR2", .type = READSTAT_TYPE_DOUBLE, .format = "F", .label_set = "F" },
{ .name = "VAR3", .type = READSTAT_TYPE_STRING, .format = "$CHAR3", .label_set = "$CHAR3" },
{ .name = "VAR3", .type = READSTAT_TYPE_STRING, .format = "$CHAR3.", .label_set = "$CHAR3." },
{ .name = "VAR4", .type = READSTAT_TYPE_STRING, .format = "COMMA10.3", .label_set = "COMMA10.3" },
{ .name = "VAR5", .type = READSTAT_TYPE_DOUBLE, .format = "YYQP1", .label_set = "YYQP1" }
{ .name = "VAR5", .type = READSTAT_TYPE_DOUBLE, .format = "YYQP1.", .label_set = "YYQP1." }
}
},
{
Expand Down
Loading