X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fproperty%2FDoublePropertyManipulator.java;h=46f892f3c849b3c0171981c56965f0f6d7dcf523;hb=refs%2Fchanges%2F88%2F3688%2F2;hp=4f7c670fc71ab186e722c31ff72adc0bab35ca71;hpb=b0e0a3863a65fa5351d8a1207f94ca37135c675a;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/g3d/property/DoublePropertyManipulator.java b/org.simantics.g3d/src/org/simantics/g3d/property/DoublePropertyManipulator.java index 4f7c670f..46f892f3 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/property/DoublePropertyManipulator.java +++ b/org.simantics.g3d/src/org/simantics/g3d/property/DoublePropertyManipulator.java @@ -11,6 +11,8 @@ *******************************************************************************/ package org.simantics.g3d.property; +import org.simantics.g3d.math.MathTools; + public class DoublePropertyManipulator implements PropertyManipulator { ValueProvider provider; @@ -43,6 +45,8 @@ public class DoublePropertyManipulator implements PropertyManipulator { try { Object value = provider.getValue(input); if (value == null) return null; + if (value instanceof Double) + return Double.toString(MathTools.round((Double)value, 10)); return value.toString(); } catch (Exception e) { return null; @@ -70,7 +74,8 @@ public class DoublePropertyManipulator implements PropertyManipulator { editMode = b; if (editMode) { try { - editValue = provider.getValue(input).toString(); + Object value = provider.getValue(input); + editValue = value.toString(); } catch (Exception e) { }