#875 Fixed wrong number of digits after punctation for numbers < 1000

This commit is contained in:
Jacob Støren 2016-09-12 15:57:55 +02:00
parent a4fb6a37ae
commit 382bf84036

View File

@ -454,7 +454,7 @@ int calculatePrecision(double value)
{
double absVal = fabs(value);
if (1e-16 < absVal && absVal < 1.0e3){
int logVal = static_cast<int>(log(absVal));
int logVal = static_cast<int>(log10(absVal));
int numDigitsAfterPoint = abs(logVal - 6);
return numDigitsAfterPoint;
}