hi all,
i have a program that read a float number, but with in the program i need 2 deal with the integer only
ex. 33.78 i need 2 deal with 33
45,01 ----> 45
66.99----->66 and so on
ghadahelal
0
Light Poster
Recommended Answers
Jump to Postsimple -- just typecast the float to an int. All decimals will be dropped, nothing rounded with this method.
float f = 12.345; int i = (int)f;
All 3 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
SpS
34
Posting Pro
ghadahelal
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.