Revision: 5388
          http://sourceforge.net/p/jump-pilot/code/5388
Author:   michaudm
Date:     2017-03-19 18:15:24 +0000 (Sun, 19 Mar 2017)
Log Message:
-----------
StringUtil : fix formatting double for NaN and Infinity

Modified Paths:
--------------
    core/trunk/src/com/vividsolutions/jump/util/StringUtil.java

Modified: core/trunk/src/com/vividsolutions/jump/util/StringUtil.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/util/StringUtil.java 2017-03-19 
15:04:34 UTC (rev 5387)
+++ core/trunk/src/com/vividsolutions/jump/util/StringUtil.java 2017-03-19 
18:15:24 UTC (rev 5388)
@@ -393,6 +393,9 @@
      * @return string
      */
     public static String toString(double d) {
+        if (Double.isNaN(d) || d == Double.POSITIVE_INFINITY || d == 
Double.NEGATIVE_INFINITY) {
+            return Double.toString(d);
+        }
         String s = allDecimals.format(d);
         double d2 = Double.valueOf(s);
         // check if we lost precision and if so we accept floating point


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to