# How to parse fraction to a number?

Considering a fraction:

val = "F \!$$\*FractionBox[\(1$$, $$1$$]\)";


I extract the part of interest:

>>    res = StringTake[val, {5, StringLength@val - 1}]
<<    "\!$$\*FractionBox[\(1$$, $$1$$]\)"


Now want to check if res is greater that 0 or no. How can I parse res to a number?

Thanks!

• Times @@ ToExpression@StringCases[res, NumberString] > 0, but I have to wonder why you're doing such machinations with this and your prior question re: numbers in strings... – ciao Jul 17 '15 at 8:46
• @ciao, I have two parts: representation and validation. – SuTron Jul 17 '15 at 9:06
• I think Divide @@ ToExpression@StringCases[res, NumberString] > 0 instead of Times .... – SuTron Jul 17 '15 at 9:09
• I think since only sign matters Times also works? – Mr.Wizard Jul 17 '15 at 9:18
• @Mr.Wizard Is this easy to find in documentation or worth an answer? – Kuba Dec 15 '15 at 21:43