sprintf(buffer,"RPM1: %d - RPM2: %d - Ratio: %d", rpm1, rpm2, ratio);
You have asked the sprintf function to treat the bits of a floating point number (ratio) as if they were an integer (%d). sprintf has no way to know that this makes no sense, so it just does it.
Usually, you'd
sprintf(buffer,"RPM1: %d - RPM2: %d - Ratio: %f", rpm1, rpm2, ratio);
but I have gotten the impression that if you want sprintf to do that, you have to compile in an extension. So what yo may want to do instead is just to do it as two ints. Print the whole part, then snip of the frational part and multiply by a thousand. Print it using a zero-padded format:
sprintf(buffer,"RPM1: %d - RPM2: %d - Ratio: %d.%03d", rpm1, rpm2,
(int) ratio, (int) ((ratio - (int)ratio) * 1000));