Skip to content

Commit

Permalink
[TD] DrawViewDimension Tolerances, print zero tolerances without plus…
Browse files Browse the repository at this point in the history
… sign and decimals.
  • Loading branch information
aapo-aapo authored and wwmayer committed Dec 30, 2020
1 parent 30fcdda commit 079b8ff
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Mod/TechDraw/App/DrawViewDimension.cpp
Expand Up @@ -786,8 +786,16 @@ std::pair<std::string, std::string> DrawViewDimension::getFormattedToleranceValu
underTolerance = underFormatSpec;
overTolerance = overFormatSpec;
} else {
underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), underFormatSpec, partial).c_str());
overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), overFormatSpec, partial).c_str());
if (DrawUtil::fpCompare(UnderTolerance.getValue(), 0.0)) {
underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), QString::fromUtf8("%.0f"), partial).c_str());
} else {
underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), underFormatSpec, partial).c_str());
}
if (DrawUtil::fpCompare(OverTolerance.getValue(), 0.0)) {
overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), QString::fromUtf8("%.0f"), partial).c_str());
} else {
overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), overFormatSpec, partial).c_str());
}
}

tolerances.first = underTolerance.toStdString();
Expand Down

0 comments on commit 079b8ff

Please sign in to comment.