Conversion of values

Hi

if i get values like 0.5 ( or something like this) by division

how I can display " 1/2 " to the users ( there be other outputs like 3/4 , 3/8 etc)

Thank you