fractionSimplify function to convert fractions to integers where required