0
Rounding double to two decimal places in Java
in
java
This is the simplest way i found.
Double num = 2.554545;
DecimalFormat twoDForm = new DecimalFormat("#.##");
return Double.valueOf(twoDForm.format(num));
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC" |
=========================================== # JSSE_HOME (Optional) May point at your Java Secure Sockets Extension # (JSSE) installation, whose JAR files will be added to the # system class path used to start Tomcat. # # CATALINA_PID (Optional) Path of the file which should contains the pid # of catalina startup java process, when start (fork) is used # # $Id: catalina.sh 609438 2008-01-06 22:14:28Z markt $ # ----------------------------------------------------------------------------- JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC" # OS specific support. $var _must_ be set to either true or false. cygwin=false os400=false darwin=false ======================================== |
This link recommends the following actions to solve this bug:
1) Add -Dsun.lang.ClassLoader.allowArraySyntax=true if you want to use a
library for which you don't have the source with JDK6
2) Change loader.loadClass( name ) to Class.forName( name, false, loader ) if
you own the code.
class org.apache.catalina.loader.WebAppClassLoader
uses this code to load classes:
clazz = loader.loadClass(name);
Can you please change the sections of code where this line is used (1352 and
others) to
clazz = Class.forName( name, false, loader);
-Dsun.lang.ClassLoader.allowArraySyntax=true
Copyright © 2009 So That I Can Remember All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.