Fractions vs decimals

Fractions vs decimals

I need to have a user enter  a fraction and display a decimal, and vice versa. How can this be programmed?

Thanks!