Adding the algorirth to calculate fractions from decimal