Unit.toString() now displays NaN as N/A. This brings it in agreement with
Unit.toStringUnit()
This commit is contained in:
parent
4d65a65a30
commit
19aed2a216
@ -90,8 +90,11 @@ public abstract class Unit {
|
|||||||
* @return A string representation of the number in these units.
|
* @return A string representation of the number in these units.
|
||||||
*/
|
*/
|
||||||
public String toString(double value) {
|
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) {
|
if (Math.abs(val) > 1E6) {
|
||||||
return expFormat.format(val);
|
return expFormat.format(val);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user