how to convert float to int in c#?
but without converting to string and then to int
Convert float to int
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend3days leftRegister
abdullah115 pointsPosted Aug 8, 2005, 1:24 PM EDT
I think cast will work.......
float x = 2.3 ;
int y = (int) x ;
Hope it will work ............Not tested........
Good Luck.....