Merge pull request #1927 from JoePfeiffer/display-NaN-as-N/A
Display nan as n/a
This commit is contained in:
commit
e9064dc759
@ -90,8 +90,11 @@ public abstract class Unit {
|
||||
* @return A string representation of the number in these units.
|
||||
*/
|
||||
public String toString(double value) {
|
||||
double val = toUnit(value);
|
||||
if (Double.isNaN(value))
|
||||
return "N/A";
|
||||
|
||||
double val = toUnit(value);
|
||||
|
||||
if (Math.abs(val) > 1E6) {
|
||||
return expFormat.format(val);
|
||||
}
|
||||
|
@ -571,7 +571,12 @@ public class ComponentAnalysisDialog extends JDialog implements StateChangeListe
|
||||
}
|
||||
|
||||
if (forces.getCP() != null) {
|
||||
row.cpx = forces.getCP().x;
|
||||
if ((comp instanceof Rocket) &&
|
||||
(forces.getCP().weight < MathUtil.EPSILON)) {
|
||||
row.cpx = Double.NaN;
|
||||
} else {
|
||||
row.cpx = forces.getCP().x;
|
||||
}
|
||||
row.cna = forces.getCNa();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user