From: <ahe...@us...> - 2009-07-17 23:28:35
|
Revision: 11241 http://jmol.svn.sourceforge.net/jmol/?rev=11241&view=rev Author: aherraez Date: 2009-07-17 23:28:33 +0000 (Fri, 17 Jul 2009) Log Message: ----------- more compact VRML: reduce number precision to 3 decimals (improved code) Modified Paths: -------------- trunk/Jmol/src/org/jmol/export/_Exporter.java Modified: trunk/Jmol/src/org/jmol/export/_Exporter.java =================================================================== --- trunk/Jmol/src/org/jmol/export/_Exporter.java 2009-07-17 22:55:16 UTC (rev 11240) +++ trunk/Jmol/src/org/jmol/export/_Exporter.java 2009-07-17 23:28:33 UTC (rev 11241) @@ -262,10 +262,8 @@ return new StringBuffer().append(0f).toString(); } - protected double round(float number) { //AH - int places = 3; - double c = Math.pow(10, places); - return (double) Math.round(number*c)/c; + protected static float round(float number) { //AH + return (float) Math.round(number*1000)/1000; // leave just 3 decimals } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |