| | |
Math output
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
Ryshad has already given you the information you need. You need to make regex patterns with groups for each math command from latex.
•
•
Join Date: Jul 2009
Posts: 123
Reputation:
Solved Threads: 10
•
•
•
•
Ryshad has already given you the information you need. You need to make regex patterns with groups for each math command from latex.
Thanks for your reply........
I don't know much about regular expression......
I tried the links given by Ryshad,they helped me but not much.....
My application is attached in this thread, Can you please give me some hint or sample example in that.Rest I 'll do it on my own.
Like for fraction ,in textbox I want "()/()" and its corresponding latex symbol is "\frac {}{}" and for nth root in textbox there is "root:{}()" and its corresponding latex symbol is "\sqrt[]{}" and so on...........
Kindly help me..........
Last edited by vinnijain; Oct 1st, 2009 at 3:51 am.
C# Syntax (Toggle Plain Text)
private void button5_Click(object sender, EventArgs e) { const string matchNumerator = @"\((?<Numerator>[\d,]*(\.\d*))\)"; const string matchDenominator = @"\((?<Denominator>[\d,]*(\.\d*))\)"; const string matchBoth = matchNumerator + @"\/" + matchDenominator; const string txtBoxInput = @"(5.2)/(4.3)"; System.Text.RegularExpressions.Match m = System.Text.RegularExpressions.Regex.Match(txtBoxInput, matchBoth); if (m.Success) { decimal dNumerator, dDenominator; if (decimal.TryParse(m.Groups["Numerator"].Value, out dNumerator) && decimal.TryParse(m.Groups["Denominator"].Value, out dDenominator)) { string latex = @"\frac {" + dNumerator.ToString() + "}{" + dDenominator.ToString() + "}"; decimal valueOut = dNumerator / dDenominator; System.Diagnostics.Debugger.Break(); } } }
•
•
Join Date: Jul 2009
Posts: 123
Reputation:
Solved Threads: 10
Thanks for this code Mr.Scott.
But this code is not working and its giving error on line :
Also,it is for particular value i.e. @"(5.2)/(4.3)" ,but I want it to use for all type of values.
Kindly help me....
But this code is not working and its giving error on line :
C# Syntax (Toggle Plain Text)
System.Diagnostics.Debugger.Break();
Kindly help me....
I know. I gave you one regex, you need to write the rest.
Please mark this thread as solved if you have found an answer to your question and good luck!
Please mark this thread as solved if you have found an answer to your question and good luck!
•
•
Join Date: Jul 2009
Posts: 123
Reputation:
Solved Threads: 10
•
•
•
•
I know. I gave you one regex, you need to write the rest.
Please mark this thread as solved if you have found an answer to your question and good luck!
So how can I proceed further.
Also,kindly give me hint for making it for all values
•
•
Join Date: Jul 2009
Posts: 123
Reputation:
Solved Threads: 10
Its giving error in line:
Since the code is for particularly for this (@"(5.2)/(4.3)") fraction value
kindly give me common hint for using it for all fraction values .
kindly resolve this error please.
C# Syntax (Toggle Plain Text)
System.Diagnostics.Debugger.Break();
Since the code is for particularly for this (@"(5.2)/(4.3)") fraction value
kindly give me common hint for using it for all fraction values .
kindly resolve this error please.
![]() |
Similar Threads
- how to use regex or an array to display some output from an arithmetic input? (VB.NET)
- Trouble with area (Java)
- math help (PHP)
- math program (C)
- Math.max prob???...XD (Java)
- So Stuck (C++)
- Assigning Array Values En Masse (Java)
- Output in Text file-How to apply fprintf()? (C)
- Output in the text file (C)
- missing function header (C++)
Other Threads in the C# Forum
- Previous Thread: How to generate button at runtime and its text from database for windows application
- Next Thread: password setting in a software
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# cast check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mailmerge mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox robot save saving serialization server sleep socket sockets sql sql-server statistics stream string stringformatting sun table tcp text textbox thread time timer update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






