Revision: 5370
http://sourceforge.net/p/jump-pilot/code/5370
Author: edso
Date: 2017-03-13 21:08:46 +0000 (Mon, 13 Mar 2017)
Log Message:
-----------
fix regression "#455 UI problem with decimal parameters and Locale"
every double is formatted to max 12 decimals unless it loses precision then the
default floating point representation achieved by Double.toString() is used
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-12
18:11:30 UTC (rev 5369)
+++ core/trunk/src/com/vividsolutions/jump/util/StringUtil.java 2017-03-13
21:08:46 UTC (rev 5370)
@@ -393,6 +393,13 @@
* @return string
*/
public static String toString(double d) {
- return allDecimals.format(d);
+ String s = allDecimals.format(d);
+ double d2 = Double.valueOf(s);
+ // check if we lost precision and if so we accept floating point
+ // representation
+ if (d != d2)
+ s = Double.toString(d);
+
+ return s;
}
}
------------------------------------------------------------------------------
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