Added floatToRatio to convert floating point values to approximate ratios for visualisations.