Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

dbGRID right justify numeric fields???

Posted on 1998-12-10
6
Medium Priority
?
751 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 40 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
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!

 
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

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!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

719 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