going from fraction to decimal is easy, you just divide. to go from decimal to fraction is a bit harder.
the algorithm i came up with for that is you multiply and if the result is an integer, that is the numerator and what you were dividing by is the denominator.
you loop through integers to find the denominator.
for example 1/4 = .25
you multiply .25 X 2 = .5 = no
.25 X 3 = .75 = no
.25 X 4 = 1 = yes
so .25 = 1/4
this works except for repeating numbers like .333333333333333333333
is there a way to make my algorithm work?