so here is my calculation and when total equals 397,683 the numbers start turning negative....why at that number and why at all? it works fine up to 397,682
long days, hours, minutes, seconds; days = (long) (total / 86400); System.out.println("" + days); total = total - (days * 86400); System.out.println("" + total); hours = (long) (total / 3600); System.out.println("" + hours); total = total - (hours * 3600); System.out.println("" + total); minutes = (long) (total / 60); System.out.println("" + minutes); total = total - (minutes * 60); System.out.println("" + total); seconds = (long) total; System.out.println("" + seconds); totalTime.setText("" + days + "d:" + hours + "h:" + minutes + "m:" + seconds + "s");
-24855
-7096.0
-1
-3496.0
-58
-16.0
-16
thats what the println display when i do 397683
24855
10800.0
3
0.0
0
0.0
0
when i do 397682


LinkBack URL
About LinkBacks
Reply With Quote
i had troopnum as an int and it couldnt hold that big of a number cant believe i missed this thanks a lot