Skip to content

Commit

Permalink
Print . in 0 precision tablular output
Browse files Browse the repository at this point in the history
  • Loading branch information
lefticus committed May 7, 2020
1 parent bc2bc0c commit 69a8940
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/OutputReportPredefined.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,7 @@ namespace OutputReportPredefined {
}

if (tableEntryReal < 1e8) { // change from 1e10 for more robust entry writing
tableEntry(numTableEntry).charEntry = format("{:12.{}F}", tableEntryReal, sigDigitCount);
tableEntry(numTableEntry).charEntry = format("{:#12.{}F}", tableEntryReal, sigDigitCount);
} else {
tableEntry(numTableEntry).charEntry = format("{:12.{}Z}", tableEntryReal, sigDigitCount);
}
Expand Down
10 changes: 4 additions & 6 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15691,12 +15691,10 @@ namespace OutputReportTabular {
// na

// FUNCTION LOCAL VARIABLE DECLARATIONS:
const auto nDigits = [&]() {
if (RealIn < 0.0) return numDigits - 1;
if (numDigits > 9) return 9;
if (numDigits < 0) return 0;
return numDigits;
}();
int nDigits = numDigits;
if (RealIn < 0.0) --nDigits;
if (nDigits > 9) nDigits = 9;
if (nDigits < 0) nDigits = 0;

if (std::abs(RealIn) > maxvalDigitsA.at(nDigits)) {
return format("{:12.6Z}", RealIn);
Expand Down

7 comments on commit 69a8940

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (12 of 12 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2818 of 2818 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1388 of 1388 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (699 of 699 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_misc_formats_from_gio (lefticus) - Win64-Windows-10-VisualStudio-16: OK (2754 of 2754 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_misc_formats_from_gio (lefticus) - x86_64-MacOS-10.13-clang: Tests Failed (0 of 0 tests passed, 0 test warnings)

Build Badge Test Badge

Please # to comment.