Ideally it would be better to have more control over the input so you know what they are and don't need extra processing. Different form inputs?
Otherwise you need to figure out what is what from the possible sting formats.
If the "fraction" will always have "/" and the "per cent" will always have "%" then I guess that would be easy enough.
You can split() the fraction string on the "/", cast to numeric and divide $piece by $piece
You could replace() the "%" with nothing to get rid of it, cast to numeric and divide by 100