I've looked at numerous formatting examples...some with minimal code...some not...
Thinking if I can nail this formatting here then I can eliminate all the code to format the DGV cells that I have been using.
Thinking if I can nail this formatting here then I can eliminate all the code to format the DGV cells that I have been using.
VB.NET:
'Valve Diameter Change
Dim vdiam = Val(Me.TextBox1.Text)
Dim varea = vdiam * vdiam * 0.7854
Dim count = Val(Me.TextBox7.Text)
Dim factor = vdiam * 3.14
For Each r As DataGridViewRow In Me.DGV1.Rows
'Populates Valve Cd Column using formula Cd = CFM / (Valve Diameter * 3.14 * lift) * 146
r.Cells(5).Value = CDbl(r.Cells(2).Value) / ((factor * CDbl(r.Cells(0).Value)) * 146) ----------<<<<<< want the result in r.cells(5) formatted for 3 decimal places
'Populates Effective Flow Area Column using formula EFA = Cd * (3.14 * lift)
r.Cells(6).Value = CDbl(r.Cells(5).Value) * (factor * CDbl(r.Cells(0).Value))
'Populates Actual Flow Area Column using Formula AFE = (vdiam * 3.14 * lift)
r.Cells(7).Value = factor * CDbl(r.Cells(0).Value)
'Populates CFM -Sq.In Column using formula = CFM / Valve Area
r.Cells(4).Value = CDbl(r.Cells(2).Value) / varea
'Calculations Valve Area
Me.TextBox9.Text = CStr(varea * count) -----<<<<<<<<< I want the value in this textbox to have 3 decimal places. Have tried Cdbl instead of Cstr and fiddled with code..no luck