]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils/src/org/simantics/utils/format/TimeFormat.java
Sync git svn branch with SVN repository r33345.
[simantics/platform.git] / bundles / org.simantics.utils / src / org / simantics / utils / format / TimeFormat.java
index 48d961134bd3aa8a52d5505393a7270fea8512b2..30451e149f9213e181bfccf6e4b4f0b7060ab282 100644 (file)
@@ -106,7 +106,13 @@ public class TimeFormat extends Format {
        private StringBuffer formatSync(Object obj, StringBuffer toAppendTo, FieldPosition pos) {\r
                double x = ( (Number) obj ).doubleValue(); \r
                int initLen = toAppendTo.length();\r
-               \r
+\r
+               if (Double.isInfinite(x)) {\r
+                       return toAppendTo.append((x == Float.POSITIVE_INFINITY) ? "\u221E" : "-\u221E");\r
+               } else if (Double.isNaN(x)) {\r
+                       return toAppendTo.append("NaN");\r
+               }\r
+\r
                if (x<0) {\r
                        toAppendTo.append("-");\r
                        x=-x;\r