Solved

dbGRID right justify numeric fields???

Posted on 1998-12-10
6
700 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
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
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
Comment Utility
FieldbyName('something').Alignment:=taRightJustify
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
hi ronit,

fieldbyname is not available in dbgrids

to set it in runtime use

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

meikl

0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
Yes, I ment Table1.FieldbyName....
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
well, this works also with table1.fieldbyname...
0
 

Author Comment

by:waipahu
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now