Advertisement

12.19.2007 at 01:38PM PST, ID: 23034619
[x]
Attachment Details

String Format c#

Asked by saswati_m in WebApplications, Web Development Software

Tags: format, string

I am getting a decimal field from the database say 45.693043. I want to convert it to String and then format it to 4 decimal places . I was originally doing like this
string interestRate = ds.Tables[0].Rows[i]["IntRate"].ToString().Trim();
string intRate = String.Format("{0:0.0000}", interestRate );
I have tried String.Format("{0:F2}", interestRate ); and N2 ...did not work ...keeps me the original string...

                           Start Free Trial
[+][-]12.19.2007 at 02:01PM PST, ID: 20503378

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.19.2007 at 02:09PM PST, ID: 20503433

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.19.2007 at 06:05PM PST, ID: 20504478

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.19.2007 at 06:10PM PST, ID: 20504491

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.20.2007 at 07:24AM PST, ID: 20507283

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.20.2007 at 11:31AM PST, ID: 20509212

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.20.2007 at 11:50AM PST, ID: 20509371

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.20.2007 at 12:06PM PST, ID: 20509498

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: WebApplications, Web Development Software
Tags: format, string
Sign Up Now!
Solution Provided By: imitchie
Participating Experts: 2
Solution Grade: A
 
 
[+][-]12.20.2007 at 12:27PM PST, ID: 20509637

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.20.2008 at 12:42PM PDT, ID: 21175075

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.20.2008 at 09:28PM PDT, ID: 21178156

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628