helper function to format rationals as floating points instead of ratios