Commit dbfd4857 authored by Stéphane  DALLONGEVILLE's avatar Stéphane DALLONGEVILLE

Merge branch 'master' of https://gitlab.pasteur.fr/bia/icy

parents 4e10066f 78f3f629
......@@ -1480,7 +1480,7 @@ public abstract class AbstractRoisPanel extends ExternalizablePanel
final Object value;
if (result != null)
value = results.formatValue(result.getValue(), id);
value = results.formatValue(result.getValue(), id, false);
else
value = null;
......@@ -1852,6 +1852,11 @@ public abstract class AbstractRoisPanel extends ExternalizablePanel
}
public Object formatValue(Object value, String id)
{
return formatValue(value, id, true);
}
public Object formatValue(Object value, String id, boolean truncateDouble)
{
Object result = value;
......@@ -1885,7 +1890,7 @@ public abstract class AbstractRoisPanel extends ExternalizablePanel
|| id.equals(ROIMassCenterTDescriptor.ID) || id.equals(ROIMassCenterCDescriptor.ID))
result = "ALL";
}
else
else if (truncateDouble)
{
// value not too large ?
if (Math.abs(doubleValue) < 10000000)
......@@ -1910,6 +1915,18 @@ public abstract class AbstractRoisPanel extends ExternalizablePanel
// format double value
result = Double.valueOf(MathUtil.roundSignificant(doubleValue, 5));
}
else
{
if (value instanceof Long || value instanceof Integer || value instanceof Short
|| value instanceof Byte)
{
result = ((Number) value).longValue();
}
else
{
result = doubleValue;
}
}
}
return result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment