954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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
 
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
435 posts since Nov 2007
Reputation Points: 49
Solved Threads: 47
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You