• + 1 comment

    And to answer your question: if you need the decimal part, then of course you shouldn't convert it, just as you said when you convert it to int the decimal part is lost. On normal basis this lost of precision isn't something that matters much, but you need to be aware of it, aspeccialy, in conditional statements. Now, when you really need great precision, for example in banks and accounting then there are classes for it.