Thread
:
transforming double to int
View Single Post
#
3
(
permalink
)
12-11-2007, 03:34 AM
staykovmarin
Senior Member
Join Date: Nov 2007
Location: Newport, WA
Posts: 141
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).
staykovmarin
View Public Profile
Send a private message to staykovmarin
Find all posts by staykovmarin