formatting number
Hi
I have doone a program such that using xpath , to read data's from xml and display it on a form.
now for ex:
XPathExpression Expr2;
Expr2 = oXPathNav.Compile("/tmp_day_stats//td_value");
XmlNamespaceManager oxmlNSManager = new XmlNamespaceManager(oXPathNav.NameTable);
oxmlNSManager.AddNamespace("tmp_day_stats", "http://myserver/myschemas/tmp_day_stats");
Expr2.SetContext(oxmlNSManager);
XPathNodeIterator iterator2 = oXPathNav.Select(Expr2);
while (iterator2.MoveNext())
{
this.textBox2.Text.ToString += this.textBox2.Text == "" ? iterator2.Current.Value: "\r\n"+ iterator2.Current.Value;
}
the above program what it does uis that read all the values of td_value from the xml file and display them in the textbox2.
ie, the output is as follows
900909.87887
980126.767
353553.543
776668.6466
now i have to format these numbers as follows
900909.87
980126.76
353553.54
776668.64
ie, after decimal i should have only 2 values to be shown.
how to format it . please help me to get this..
DHOL
__________________
SureShot
|