A ratio can be defined in a new ways. Let's say I have a party with twelve people, four of whom are male and eight of whom are female. The ratio of male to female guests would be written as 4:8, neither of which is the whole number (12) but which instead relate parts of the whole. I could alternatively write the ratio of male guests to total guests as 4/12. This does compare it to the whole. A ratio relates two quantities by showing how many times one quantity is contained within or contains another quantity.
By the phrasing of your question, I'm not sure if you maybe mean whole number as an integer. If that's the case, then yes, ratios are almost always written as integers. If I had something like 8.5:7, I would multiply it by two to get 17:14, which is a correct ratio.