Fixed decimal entry and display in a DBGrid

Posted on 2007-10-03
Last Modified: 2012-05-05
If I want a number to always be displayed in a fixed decimal format (always 1 decimal digit and always as least 1 digit to the left of the decimal) and I want to similarly limit the user input, how is this best accomplished?  Data is being displayed and entered into a DBGrid sourced by a SQL Server database via TADO components.
- Thanks. -
Question by:ttheimer
    LVL 17

    Expert Comment

    in the field definition for that field, set the DisplayFormat to 0.0
    LVL 17

    Accepted Solution

    same for 'EditFormat' also

    Author Comment

    Had to hunt some to locate these properties in a DevEx control - found them in the CurrencyEdit - works great!  Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    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…
    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…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    760 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

    8 Experts available now in Live!

    Get 1:1 Help Now