Issue with calculation code in JSP / JAVA -
hope can me 1 :( right ... trying calculate ticket costs shows first 2 digits , ignores decimals, replaces decimals .00
code within javabean:
ticketcosts.put(results.getstring(1), double.valueof(results.getint(2)));
any ideas, ... :(
instead of
ticketcosts.put(results.getstring(1), double.valueof(results.getint(2)))
use getdouble method of resultset
ticketcosts.put(results.getstring(1), results.getdouble(2))
http://docs.oracle.com/javase/1.5.0/docs/api/java/sql/resultset.html#getdouble(int)
Comments
Post a Comment