Waqas Ali

Waqas Ali

  • NA
  • 19
  • 27.7k

Help removing unwanted decimal places ???

Jul 24 2012 9:12 AM
Hello,
This is my code
            decimal averagePrice = (decimal)dvdDS.Tables["manager"].Compute("Avg(Price)", "");
            
            textBox3.Text = Convert.ToString(averagePrice);

I want the textbox to display "averagePrice" upto 3 decimal places. 
eg I get: 6.66666666666666666
    I want: 6.666

Any help would be appreciated
Thank You

Answers (4)