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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -