diff --git a/src/Gui/SoFCColorGradient.cpp b/src/Gui/SoFCColorGradient.cpp index 6e7c709617..048cc481d4 100644 --- a/src/Gui/SoFCColorGradient.cpp +++ b/src/Gui/SoFCColorGradient.cpp @@ -161,14 +161,12 @@ void SoFCColorGradient::setRange(float fMin, float fMax, int prec) // otherwise output "normal" (fixed notation) SoMFString label; - std::ios::fmtflags flags = 0; + std::ios::fmtflags flags = (std::ios::fixed | std::ios::showpoint | std::ios::showpos); float eps = std::pow(10.0f, static_cast(-prec)); - if ((std::min(fabs(fMin), fabs(fMax)) < eps) - || (std::max(fabs(fMin), fabs(fMax)) > 1e4)) + if ( ( (std::min(fabs(fMin), fabs(fMax)) < eps) && (std::min(fabs(fMin), fabs(fMax)) != 0.0f) ) + || (std::max(fabs(fMin), fabs(fMax)) > 1e4) ) flags = (std::ios::scientific | std::ios::showpoint | std::ios::showpos); - else - flags = (std::ios::fixed | std::ios::showpoint | std::ios::showpos); // write the labels int i = 0;