Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format numbers in MSHFlexGrid column

Status
Not open for further replies.

atroy

Programmer
Jun 17, 2002
7
0
0
GB
How do I format the numbers in an MSHFlexGrid column to one decimal place.

I have an MSHFlexGrid that is displaying Item numbers in the first column from an Access database. The datasource is an ADODC. I am performing a query on the database as follows:

adoSavedData.RecordSource = "SELECT * FROM savedorder WHERE ref = '" & VarOrdNo & "' ORDER BY item"

I am then filling the MSHFlexGrid with the results of the query. The 'item' field in the database is set to a Data Type of Number(Double). Typical item numbers in the database are 1, 1.1, 2, 2.1 etc. The problem is where there is an item number of e.g. 1.1 it is displayed in the FlexGrid as 1.1000000000000001 instead of 1.1

Any help much appreciated.
 
When the grid is being filled use the format function.

Format(YourNumber,"#,###,##0.0") Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top