Solved

dbGRID right justify numeric fields???

Posted on 1998-12-10
6
733 Views
Last Modified: 2010-04-04
How do you make a numeric field in dbGRID right jusftified?
I want all my money to be right jusftified:

  52.34
   1.21
 123.45

not
52.12
125.54
1.21
1
anywobyd know how?
thanks
0
Comment
Question by:waipahu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1350307
hi waipahu,

i wonder, because is a field in a table of typ numeric, then there becomes the rightjustify automatically.

you can adjust the allignment of the colums with the colum-editor, which comes up by doubleclicking the grid, add there all fields (table must be open in this case), select the field you want to modify, in the objectinspector set the allignment you want.

meikl
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 10 total points
ID: 1350308
FieldbyName('something').Alignment:=taRightJustify
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1350309
hi ronit,

fieldbyname is not available in dbgrids

to set it in runtime use

  dbgrid1.fields[indexofthefield].alignment := tarightjustify;

meikl

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ronit051397
ID: 1350310
Yes, I ment Table1.FieldbyName....
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1350311
well, this works also with table1.fieldbyname...
0
 

Author Comment

by:waipahu
ID: 1350312
Thanks for the help. It works...i just specified it as right justified.
I have another problem...formating the numeric field to display 2 digits after
the decimal point:

22.50 displays as 22.5

Using borland's DBE it will work, however using TOPAZ i dont know how
to format the numeric field as 99.99

anyone have any ideas?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month5 days, 5 hours left to enroll

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question