Start New Discussion Reply to this Discussion How to set decimal digits to 2 for a double type data field in grid control
I m using VB6 and MS Access.
In MS Access table I have already set the decimal digit to 2 and it is showing only 2 digits after decimal in MS Access Table
but when I put the data in
MSH Flex grid then it shows around 12 to 14 decimal digits.
How to fix this.
Is there any property for grid controls
Or how to resolve through coding.
Please suggest a better site for the study of MSHFlex Grid control..
Thnx.
dilip_singh3
Newbie Poster
24 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Is there any property for grid controls
Or how to resolve through coding.
Thnx.
use the format function:
format(sngValue, "##.##")
Private Sub Form_Load()
Dim sngValue as Single
sngValue = 52.345
MSFlexGrid1.Col = 1
MSFlexGrid1.Row = 1
MSFlexGrid1.Text = Format(sngValue, "##.##")
End Sub
Notice, you have to set the Column and row you're working with before setting the value of the text.
Check your MSDN documentation of the format property.
hkdani
Posting Pro in Training
439 posts since Nov 2007
Reputation Points: 61
Solved Threads: 48
Skill Endorsements: 2
© 2013 DaniWeb® LLC
Page generated in 0.3029 seconds
using 2.65MB