How to convert fraction to a whole number?