Will you need to perform calculations within your application on this number, now or possibly in the future? Or is it strictly for reference (user lookup)?
If the former, go with David's approach to preserve the numeric type. You mention needing two decimal places. The mask string to use would be "#0.00", if you want thousands separators in there use "#,##0.00". If the latter, consider Sean's suggestion. Good luck --- In advanced_delphi@yahoogroups.com, pietro <pietro.bo...@...> wrote: > > Hi All, > > I am writing my first ADO / dBase program and I have problem with data > inside a DBGrid: (data are from an MS Access table and I use Delphi-7 > enterprise) > > I have a field where I would like to represent a frequency (let say a > number), example 900.00 or 1034.23, so always with two decimal position > after the integer part. > > - If I use the field as a string, all seem ok, but when sorting I have > (from top-to bottom): 1024.67 - 3345.99 - 558.00 - 900.00 etc..., the > sorting is on first character of the number (1-2-3-4-5-6-7-8-9), so > there is no correlation with the "numerical value" ... from the smaller > number to the biggest number (in effect I want to have: 558.00 - 900.00 > - 1024.67 - 3345.99, etc...) > > - If I use the field as number, I can achieve the correct sorting > sequence (smaller - to - biggest number) but number with two zero on > decimal part will only represented with integer part: 990.00 = 990 > > Is there a way to solve my problem ??? > > I try also to use a TMS DBadvGrid (that's very beautiful and nice), but > to activate the sorting I must set PageMode = false, then clicking on a > DBgrid row, I don't know how to select a record to edit, it's always > pointing to the last record of the table. > > Pleaseeeeeeeeee help !! > > TNX, Pietro >