• Post Reply Bookmark Topic Watch Topic
  • New Topic

Rounding up number  RSS feed

 
Ikasari Widiyanto
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to know how to round up number in jsp whether it is below 0.5 or above 0.5... my sample code:

double totalquantity=0;
int totalratio = 0;
long q = 0;
.
.
.
ratio = rs.getString("ratio");
q = totalquantity/totalratio * Integer.parseInt(ratio);
.
.
.
thank you
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not much to do with JSP, so moving along to Java in General(intermediate).
 
sorna latha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the round fun in the math class
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!