Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit a5536c72 authored by frey_m's avatar frey_m
Browse files

Add fC instead std::scientific

parent 358361d3
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ namespace Util { ...@@ -45,7 +45,7 @@ namespace Util {
} }
std::stringstream timeOutput; std::stringstream timeOutput;
timeOutput << std::scientific << std::setw(precision + 2) << std::setprecision(precision) << time << timeUnit; timeOutput << std::fixed << std::setw(precision + 2) << std::setprecision(precision) << time << timeUnit;
return timeOutput.str(); return timeOutput.str();
} }
...@@ -64,7 +64,7 @@ namespace Util { ...@@ -64,7 +64,7 @@ namespace Util {
} }
std::stringstream positionOutput; std::stringstream positionOutput;
positionOutput << std::scientific << std::setw(precision + 2) << std::setprecision(precision) << spos << sposUnit; positionOutput << std::fixed << std::setw(precision + 2) << std::setprecision(precision) << spos << sposUnit;
return positionOutput.str(); return positionOutput.str();
} }
...@@ -90,7 +90,7 @@ namespace Util { ...@@ -90,7 +90,7 @@ namespace Util {
sposUnit = std::string(" [um]"); sposUnit = std::string(" [um]");
} }
positionOutput << std::scientific << std::setprecision(precision) positionOutput << std::fixed << std::setprecision(precision)
<< "( " << "( "
<< std::setw(precision + 7) << spos(0) << " , " << std::setw(precision + 7) << spos(0) << " , "
<< std::setw(precision + 7) << spos(1) << " , " << std::setw(precision + 7) << spos(1) << " , "
...@@ -117,16 +117,22 @@ namespace Util { ...@@ -117,16 +117,22 @@ namespace Util {
} }
std::stringstream energyOutput; std::stringstream energyOutput;
energyOutput << std::scientific << std::setw(precision + 2) << std::setprecision(precision) << energy << energyUnit; energyOutput << std::fixed << std::setw(precision + 2) << std::setprecision(precision) << energy << energyUnit;
return energyOutput.str(); return energyOutput.str();
} }
inline inline
std::string getChargeString(double charge, unsigned int precision = 3) { std::string getChargeString(double charge, unsigned int precision = 3) {
std::string chargeUnit(" [pC]"); std::string chargeUnit(" [fC]");
charge *= 1e12; charge *= 1e15;
if (std::abs(charge) > 1000.0) {
charge /= 1000.0;
chargeUnit = std::string(" [pC]");
}
if (std::abs(charge) > 1000.0) { if (std::abs(charge) > 1000.0) {
charge /= 1000.0; charge /= 1000.0;
chargeUnit = std::string(" [nC]"); chargeUnit = std::string(" [nC]");
...@@ -138,7 +144,7 @@ namespace Util { ...@@ -138,7 +144,7 @@ namespace Util {
} }
std::stringstream chargeOutput; std::stringstream chargeOutput;
chargeOutput << std::scientific << std::setw(precision + 2) << std::setprecision(precision) << charge << chargeUnit; chargeOutput << std::fixed << std::setw(precision + 2) << std::setprecision(precision) << charge << chargeUnit;
return chargeOutput.str(); return chargeOutput.str();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment