I have a float like so 23.248500. Is it possible for me to just get the 23 part and the 0.248500 part separately?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For positive numbers, you can use
floor(f)function to get23, andf - floor(f)to get the0.248500part.(I linked C++ reference, but the same function is present in the C library).