Converting rational numbers to fraction form