View Single Post
  #3 (permalink)  
Old 12-11-2007, 03:34 AM
staykovmarin staykovmarin is offline
Senior Member
 
Join Date: Nov 2007
Location: Newport, WA
Posts: 141
staykovmarin is on a distinguished road
Or you could always cast (although that is not as safe, since it can fail)
Code:
double d = 7.8; int i = (int) d;
note: that wont round. it will give you 7, although it should give you 8 (since we round up).
Reply With Quote