Simplify MmToString. NFC.

pull/620/head
whitequark 2020-05-21 11:17:28 +00:00
parent 70ec7cc257
commit 51f62362a1
1 changed files with 1 additions and 8 deletions

View File

@ -322,14 +322,7 @@ const char *SolveSpaceUI::UnitName() {
std::string SolveSpaceUI::MmToString(double v) {
v /= MmPerUnit();
switch(viewUnits) {
case Unit::INCHES:
return ssprintf("%.*f", afterDecimalInch, v);
case Unit::METERS:
case Unit::MM:
return ssprintf("%.*f", afterDecimalMm, v);
}
return "";
return ssprintf("%.*f", UnitDigitsAfterDecimal(), v);
}
static const char *DimToString(int dim) {
switch(dim) {