View Single Post
  #1 (permalink)  
Old 07-18-2007, 07:44 PM
silvia silvia is offline
Member
 
Join Date: Jul 2007
Posts: 35
silvia is on a distinguished road
Help with java Rounding
Hi, I want to get my Java application to be able to round double varibles, but I do not want to use math.round(), I want to do this another way...

I was thinking of maybe dividing the double variable let say i have

Code:
double z;
then in an if statement dividing the input z by one but only retaning the remainder z%1, the if the remainder is less than .49 print (int)z, or something not sure what way to go here, and if the remainder is greater than .50 then z++. I am still not sure of how to actually set this up.

Thanks
Reply With Quote
Sponsored Links