4
Answers

Help removing unwanted decimal places ???

Waqas Ali

Waqas Ali

12y
3.2k
1
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)
Next Recommended Forum