Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format numbers to 3 decimal place in datagridview using vb.net

I have a vb.net windows forms application that is using a datagridview. I'm hoping to find a simple way to format certain datagridview cells numbers upto 3 decimal places. This is what I have done so far, but it doesn't seem to format everything correctly.

DataGridView1.Columns(3).DefaultCellStyle.Format = "#.###" 
like image 289
stackexchange12 Avatar asked Nov 18 '13 16:11

stackexchange12


1 Answers

Do you try with this one?

DataGridView1.Columns(2).DefaultCellStyle.Format = "N3"

Also this one may helpful:

  • Format Datagridview columns to numeric
like image 187
ridoy Avatar answered Sep 22 '22 21:09

ridoy