Skip to content

Commit

Permalink
Update UnitsSchemaMKS.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
FEA-eng authored Mar 15, 2024
1 parent 793fb4f commit 2de289f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Base/UnitsSchemaMKS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,24 @@ QString UnitsSchemaMKS::schemaTranslate(const Quantity& quant, double& factor, Q
factor = 1e9;
}
}
else if (unit == Unit::Moment) {
if (UnitValue < 1e3) {
unitString = QString::fromLatin1("mN*m");
factor = 1.0;
}
else if (UnitValue < 1e6) {
unitString = QString::fromLatin1("N*m");
factor = 1e3;
}
else if (UnitValue < 1e9) {
unitString = QString::fromLatin1("kN*m");
factor = 1e6;
}
else {
unitString = QString::fromLatin1("MN*m");
factor = 1e9;
}
}
else if (unit == Unit::Power) {
if (UnitValue < 1e6) {
unitString = QString::fromLatin1("mW");
Expand Down

0 comments on commit 2de289f

Please sign in to comment.