Skip to content

Commit

Permalink
Fix formatting of SolutionArray columns that are all integers
Browse files Browse the repository at this point in the history
Make it explicit that these should be printed as integers. Behavior of {fmt}
is different between 6.1.2, which always includes a decimal digit when the
input type is double if no other formatting specifier is provided, and later
versions which format integral doubles as doubles.

Fixes Cantera#1526
  • Loading branch information
speth authored and ischoegl committed Jul 18, 2023
1 parent 3a5da3c commit 5f52ba8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/base/SolutionArray.cpp
Original file line number Diff line number Diff line change
@@ -273,7 +273,7 @@ vector<string> doubleColumn(string name, const vector<double>& comp,
notation = fmt::format(" {{:>{}.{}f}}", over + maxLen, tail);
} else {
// all entries are integers
notation = fmt::format(" {{:>{}}}", over + maxLen);
notation = fmt::format(" {{:>{}.0f}}", over + maxLen);
}
maxLen = fmt::format(notation, 0.).size();

0 comments on commit 5f52ba8

Please sign in to comment.