From 72d9978cace102bdf3992ee86888bcf2c8441b59 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 21 May 2020 11:22:09 +0000 Subject: [PATCH] Eliminate a trailing dot before the SI prefix if there are no decimals. Fixes #617. --- src/solvespace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvespace.cpp b/src/solvespace.cpp index 3af69125..c88f50a7 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -365,7 +365,7 @@ std::string SolveSpaceUI::MmToStringSI(double v, int dim) { v /= pow(10.0, sdeg * dim); } int pdeg = (int)ceil(log10(fabs(v) + 1e-10)); - return ssprintf("%#.*g%s%s%s", pdeg + UnitDigitsAfterDecimal(), v, + return ssprintf("%.*g%s%s%s", pdeg + UnitDigitsAfterDecimal(), v, compact ? "" : " ", unit.c_str(), DimToString(dim)); } std::string SolveSpaceUI::DegreeToString(double v) {