Solved

dbGRID right justify numeric fields???

Posted on 1998-12-10
6
710 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 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