X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fproperty%2FDoubleArrayPropertyManipulator2.java;h=9275bfead2e9dbdfc63bf1dc196472eeb1fbaf1f;hb=refs%2Fchanges%2F88%2F3688%2F2;hp=82e9a0622b56be02123b27d33889f85af2968236;hpb=01441002a94a1f4ad2b078d63cb719ce617bd6cf;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/g3d/property/DoubleArrayPropertyManipulator2.java b/org.simantics.g3d/src/org/simantics/g3d/property/DoubleArrayPropertyManipulator2.java index 82e9a062..9275bfea 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/property/DoubleArrayPropertyManipulator2.java +++ b/org.simantics.g3d/src/org/simantics/g3d/property/DoubleArrayPropertyManipulator2.java @@ -11,6 +11,8 @@ *******************************************************************************/ package org.simantics.g3d.property; +import org.simantics.g3d.math.MathTools; + public class DoubleArrayPropertyManipulator2 implements PropertyManipulator { ValueProvider provider; @@ -51,11 +53,13 @@ public class DoubleArrayPropertyManipulator2 implements PropertyManipulator { } try { double[] val = getValue(); + if (val == null) + return null; if (val.length == i) return "New"; if (val.length < i) return null; - return Double.toString(val[i]); + return Double.toString(MathTools.round(val[i], 10)); } catch (Exception e) { return null; }