mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-20 04:29:02 +00:00
handle NaN
This commit is contained in:
parent
1ee6cf4115
commit
0ee07d662a
@ -125,6 +125,8 @@ class Cell implements Comparable<Cell>, Value
|
|||||||
return justify (value.getText (), colWidth);
|
return justify (value.getText (), colWidth);
|
||||||
|
|
||||||
Double thisValue = value.getValue ();
|
Double thisValue = value.getValue ();
|
||||||
|
if (thisValue.isNaN ())
|
||||||
|
return justify ("NaN", colWidth);
|
||||||
|
|
||||||
char format = cellFormat != ' ' ? cellFormat : defaultFormat;
|
char format = cellFormat != ' ' ? cellFormat : defaultFormat;
|
||||||
if (format == 'I')
|
if (format == 'I')
|
||||||
@ -213,7 +215,7 @@ class Cell implements Comparable<Cell>, Value
|
|||||||
{
|
{
|
||||||
if (!isValue ())
|
if (!isValue ())
|
||||||
{
|
{
|
||||||
// System.out.println ("Not a value");
|
// System.out.println (value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
assert isValue () : "Cell type: " + type + " @ " + address;
|
assert isValue () : "Cell type: " + type + " @ " + address;
|
||||||
|
@ -31,6 +31,7 @@ class Count extends Function
|
|||||||
if (cell.getValue () != 0.0)
|
if (cell.getValue () != 0.0)
|
||||||
value++;
|
value++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -272,6 +272,7 @@ class Expression implements Value
|
|||||||
else if (text.charAt (ptr) == '(')
|
else if (text.charAt (ptr) == '(')
|
||||||
++depth;
|
++depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
return text.substring (0, ptr + 1); // include closing parenthesis
|
return text.substring (0, ptr + 1); // include closing parenthesis
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user