Convert a text fraction to a decimal (C#)
<p>Similar to <a href="http://stackoverflow.com/questions/7142657/convert-fraction-string-to-decimal">this question</a> just in C# instead of JavaScript. I couldn't find anything for C# while searching</p>

<p>I have a text box that will take a quantity, which is later stored as a double in a database. However it is possible that some quantities will be entered as string fractions e.g 1/2 for 0.5.
I want to be able to convert these to decimal before storing them to the database (being able to also convert back would be nice but not necessary). I want to be able to handle both fractions and mixed numbers e.g. 2 1/2 is saved as 2.5</p>

<p>Anybody know a way of doing this?</p>

<p>EDIT: Thank you everyone for your answers, I had not realised there was so many ways to do this. Many thanks!</p>
